src/hotspot/share/opto/loopnode.cpp
changeset 48595 5d699d81c10c
parent 48528 b329894ee5a2
child 48603 e5da6c246176
equal deleted inserted replaced
48594:4e4929530412 48595:5d699d81c10c
     1 /*
     1 /*
     2  * Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 1998, 2018, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.
     7  * published by the Free Software Foundation.
    68 bool LoopNode::is_valid_counted_loop() const {
    68 bool LoopNode::is_valid_counted_loop() const {
    69   if (is_CountedLoop()) {
    69   if (is_CountedLoop()) {
    70     CountedLoopNode*    l  = as_CountedLoop();
    70     CountedLoopNode*    l  = as_CountedLoop();
    71     CountedLoopEndNode* le = l->loopexit();
    71     CountedLoopEndNode* le = l->loopexit();
    72     if (le != NULL &&
    72     if (le != NULL &&
    73         le->proj_out(1 /* true */) == l->in(LoopNode::LoopBackControl)) {
    73         le->proj_out_or_null(1 /* true */) == l->in(LoopNode::LoopBackControl)) {
    74       Node* phi  = l->phi();
    74       Node* phi  = l->phi();
    75       Node* exit = le->proj_out(0 /* false */);
    75       Node* exit = le->proj_out_or_null(0 /* false */);
    76       if (exit != NULL && exit->Opcode() == Op_IfFalse &&
    76       if (exit != NULL && exit->Opcode() == Op_IfFalse &&
    77           phi != NULL && phi->is_Phi() &&
    77           phi != NULL && phi->is_Phi() &&
    78           phi->in(LoopNode::LoopBackControl) == l->incr() &&
    78           phi->in(LoopNode::LoopBackControl) == l->incr() &&
    79           le->loopnode() == l && le->stride_is_con()) {
    79           le->loopnode() == l && le->stride_is_con()) {
    80         return true;
    80         return true;
  1214 IfFalseNode* OuterStripMinedLoopNode::outer_loop_exit() const {
  1214 IfFalseNode* OuterStripMinedLoopNode::outer_loop_exit() const {
  1215   IfNode* le = outer_loop_end();
  1215   IfNode* le = outer_loop_end();
  1216   if (le == NULL) {
  1216   if (le == NULL) {
  1217     return NULL;
  1217     return NULL;
  1218   }
  1218   }
  1219   Node* c = le->proj_out(false);
  1219   Node* c = le->proj_out_or_null(false);
  1220   if (c == NULL) {
  1220   if (c == NULL) {
  1221     return NULL;
  1221     return NULL;
  1222   }
  1222   }
  1223   return c->as_IfFalse();
  1223   return c->as_IfFalse();
  1224 }
  1224 }