src/share/vm/opto/loopnode.cpp

changeset 9977
e649f2136368
parent 9922
f7691a80458c
child 10015
eb7ce841ccec
equal deleted inserted replaced
9976:f415b5fea90d 9977:e649f2136368
3280 } 3280 }
3281 assert(!had_error, "bad dominance"); 3281 assert(!had_error, "bad dominance");
3282 return LCA; 3282 return LCA;
3283 } 3283 }
3284 3284
3285 // Check the shape of the graph at the loop entry. In some cases,
3286 // the shape of the graph does not match the shape outlined below.
3287 // That is caused by the Opaque1 node "protecting" the shape of
3288 // the graph being removed by, for example, the IGVN performed
3289 // in PhaseIdealLoop::build_and_optimize().
3290 //
3291 // After the Opaque1 node has been removed, optimizations (e.g., split-if,
3292 // loop unswitching, and IGVN, or a combination of them) can freely change
3293 // the graph's shape. As a result, the graph shape outlined below cannot
3294 // be guaranteed anymore.
3295 bool PhaseIdealLoop::is_canonical_main_loop_entry(CountedLoopNode* cl) {
3296 assert(cl->is_main_loop(), "check should be applied to main loops");
3297 Node* ctrl = cl->in(LoopNode::EntryControl);
3298 if (ctrl == NULL || (!ctrl->is_IfTrue() && !ctrl->is_IfFalse())) {
3299 return false;
3300 }
3301 Node* iffm = ctrl->in(0);
3302 if (iffm == NULL || !iffm->is_If()) {
3303 return false;
3304 }
3305 Node* bolzm = iffm->in(1);
3306 if (bolzm == NULL || !bolzm->is_Bool()) {
3307 return false;
3308 }
3309 Node* cmpzm = bolzm->in(1);
3310 if (cmpzm == NULL || !cmpzm->is_Cmp()) {
3311 return false;
3312 }
3313 Node* opqzm = cmpzm->in(2);
3314 if (opqzm == NULL || opqzm->Opcode() != Op_Opaque1) {
3315 return false;
3316 }
3317 return true;
3318 }
3319
3285 //------------------------------get_late_ctrl---------------------------------- 3320 //------------------------------get_late_ctrl----------------------------------
3286 // Compute latest legal control. 3321 // Compute latest legal control.
3287 Node *PhaseIdealLoop::get_late_ctrl( Node *n, Node *early ) { 3322 Node *PhaseIdealLoop::get_late_ctrl( Node *n, Node *early ) {
3288 assert(early != NULL, "early control should not be NULL"); 3323 assert(early != NULL, "early control should not be NULL");
3289 3324

mercurial