src/share/vm/opto/loopnode.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File
*** old/src/share/vm/opto/loopnode.cpp	Fri Mar 18 18:03:45 2016
--- new/src/share/vm/opto/loopnode.cpp	Fri Mar 18 18:03:44 2016

*** 3273,3282 **** --- 3273,3317 ---- } assert(!had_error, "bad dominance"); return LCA; } + // Check the shape of the graph at the loop entry. In some cases, + // the shape of the graph does not match the shape outlined below. + // That is caused by the Opaque1 node "protecting" the shape of + // the graph being removed by, for example, the IGVN performed + // in PhaseIdealLoop::build_and_optimize(). + // + // After the Opaque1 node has been removed, optimizations (e.g., split-if, + // loop unswitching, and IGVN, or a combination of them) can freely change + // the graph's shape. As a result, the graph shape outlined below cannot + // be guaranteed anymore. + bool PhaseIdealLoop::is_canonical_main_loop_entry(CountedLoopNode* cl) { + assert(cl->is_main_loop(), "check should be applied to main loops"); + Node* ctrl = cl->in(LoopNode::EntryControl); + if (ctrl == NULL || (!ctrl->is_IfTrue() && !ctrl->is_IfFalse())) { + return false; + } + Node* iffm = ctrl->in(0); + if (iffm == NULL || !iffm->is_If()) { + return false; + } + Node* bolzm = iffm->in(1); + if (bolzm == NULL || !bolzm->is_Bool()) { + return false; + } + Node* cmpzm = bolzm->in(1); + if (cmpzm == NULL || !cmpzm->is_Cmp()) { + return false; + } + Node* opqzm = cmpzm->in(2); + if (opqzm == NULL || opqzm->Opcode() != Op_Opaque1) { + return false; + } + return true; + } + //------------------------------get_late_ctrl---------------------------------- // Compute latest legal control. Node *PhaseIdealLoop::get_late_ctrl( Node *n, Node *early ) { assert(early != NULL, "early control should not be NULL");

src/share/vm/opto/loopnode.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File