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

src/share/vm/opto/loopPredicate.cpp

Print this page
rev 8160 : 8078426: mb/jvm/compiler/InterfaceCalls/testAC2 - assert(predicate_proj == 0L) failed: only one predicate entry expected
Summary: split if finds predicates on several incoming paths when unswitched's loops are optimized out
Reviewed-by:
rev 8999 : 8134974: 8130847 broken with loop predicates
Summary: Pinned eliminated arraycopy loads in uncommon trap path for loop predicates may need to be moved
Reviewed-by:


  95   assert(cont_proj->is_uncommon_trap_if_pattern(reason), "must be a uct if pattern!");
  96   IfNode* iff = cont_proj->in(0)->as_If();
  97 
  98   ProjNode *uncommon_proj = iff->proj_out(1 - cont_proj->_con);
  99   Node     *rgn   = uncommon_proj->unique_ctrl_out();
 100   assert(rgn->is_Region() || rgn->is_Call(), "must be a region or call uct");
 101 
 102   uint proj_index = 1; // region's edge corresponding to uncommon_proj
 103   if (!rgn->is_Region()) { // create a region to guard the call
 104     assert(rgn->is_Call(), "must be call uct");
 105     CallNode* call = rgn->as_Call();
 106     IdealLoopTree* loop = get_loop(call);
 107     rgn = new RegionNode(1);
 108     rgn->add_req(uncommon_proj);
 109     register_control(rgn, loop, uncommon_proj);
 110     _igvn.replace_input_of(call, 0, rgn);
 111     // When called from beautify_loops() idom is not constructed yet.
 112     if (_idom != NULL) {
 113       set_idom(call, rgn, dom_depth(rgn));
 114     }







 115   } else {
 116     // Find region's edge corresponding to uncommon_proj
 117     for (; proj_index < rgn->req(); proj_index++)
 118       if (rgn->in(proj_index) == uncommon_proj) break;
 119     assert(proj_index < rgn->req(), "sanity");
 120   }
 121 
 122   Node* entry = iff->in(0);
 123   if (new_entry != NULL) {
 124     // Clonning the predicate to new location.
 125     entry = new_entry;
 126   }
 127   // Create new_iff
 128   IdealLoopTree* lp = get_loop(entry);
 129   IfNode *new_iff = iff->clone()->as_If();
 130   new_iff->set_req(0, entry);
 131   register_control(new_iff, lp, entry);
 132   Node *if_cont = new IfTrueNode(new_iff);
 133   Node *if_uct  = new IfFalseNode(new_iff);
 134   if (cont_proj->is_IfFalse()) {




  95   assert(cont_proj->is_uncommon_trap_if_pattern(reason), "must be a uct if pattern!");
  96   IfNode* iff = cont_proj->in(0)->as_If();
  97 
  98   ProjNode *uncommon_proj = iff->proj_out(1 - cont_proj->_con);
  99   Node     *rgn   = uncommon_proj->unique_ctrl_out();
 100   assert(rgn->is_Region() || rgn->is_Call(), "must be a region or call uct");
 101 
 102   uint proj_index = 1; // region's edge corresponding to uncommon_proj
 103   if (!rgn->is_Region()) { // create a region to guard the call
 104     assert(rgn->is_Call(), "must be call uct");
 105     CallNode* call = rgn->as_Call();
 106     IdealLoopTree* loop = get_loop(call);
 107     rgn = new RegionNode(1);
 108     rgn->add_req(uncommon_proj);
 109     register_control(rgn, loop, uncommon_proj);
 110     _igvn.replace_input_of(call, 0, rgn);
 111     // When called from beautify_loops() idom is not constructed yet.
 112     if (_idom != NULL) {
 113       set_idom(call, rgn, dom_depth(rgn));
 114     }
 115     for (DUIterator_Fast imax, i = uncommon_proj->fast_outs(imax); i < imax; i++) {
 116       Node* n = uncommon_proj->fast_out(i);
 117       if (n->is_Load() || n->is_Store()) {
 118         _igvn.replace_input_of(n, 0, rgn);
 119         --i; --imax;
 120       }
 121     }
 122   } else {
 123     // Find region's edge corresponding to uncommon_proj
 124     for (; proj_index < rgn->req(); proj_index++)
 125       if (rgn->in(proj_index) == uncommon_proj) break;
 126     assert(proj_index < rgn->req(), "sanity");
 127   }
 128 
 129   Node* entry = iff->in(0);
 130   if (new_entry != NULL) {
 131     // Clonning the predicate to new location.
 132     entry = new_entry;
 133   }
 134   // Create new_iff
 135   IdealLoopTree* lp = get_loop(entry);
 136   IfNode *new_iff = iff->clone()->as_If();
 137   new_iff->set_req(0, entry);
 138   register_control(new_iff, lp, entry);
 139   Node *if_cont = new IfTrueNode(new_iff);
 140   Node *if_uct  = new IfFalseNode(new_iff);
 141   if (cont_proj->is_IfFalse()) {


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