src/hotspot/share/opto/loopopts.cpp
changeset 58006 cf8164854fda
parent 57801 aff991f6e64d
child 58285 1182ff8929cc
equal deleted inserted replaced
58005:9ee010450e84 58006:cf8164854fda
  1189   }
  1189   }
  1190 
  1190 
  1191   return true;
  1191   return true;
  1192 }
  1192 }
  1193 
  1193 
       
  1194 // Detect if the node is the inner strip-mined loop
       
  1195 // Return: NULL if it's not the case, or the exit of outer strip-mined loop
       
  1196 static Node* is_inner_of_stripmined_loop(const Node* out) {
       
  1197   Node* out_le = NULL;
       
  1198 
       
  1199   if (out->is_CountedLoopEnd()) {
       
  1200       const CountedLoopNode* loop = out->as_CountedLoopEnd()->loopnode();
       
  1201 
       
  1202       if (loop != NULL && loop->is_strip_mined()) {
       
  1203         out_le = loop->in(LoopNode::EntryControl)->as_OuterStripMinedLoop()->outer_loop_exit();
       
  1204       }
       
  1205   }
       
  1206 
       
  1207   return out_le;
       
  1208 }
       
  1209 
  1194 //------------------------------split_if_with_blocks_post----------------------
  1210 //------------------------------split_if_with_blocks_post----------------------
  1195 // Do the real work in a non-recursive function.  CFG hackery wants to be
  1211 // Do the real work in a non-recursive function.  CFG hackery wants to be
  1196 // in the post-order, so it can dirty the I-DOM info and not use the dirtied
  1212 // in the post-order, so it can dirty the I-DOM info and not use the dirtied
  1197 // info.
  1213 // info.
  1198 void PhaseIdealLoop::split_if_with_blocks_post(Node *n) {
  1214 void PhaseIdealLoop::split_if_with_blocks_post(Node *n) {
  1322       // Now search up IDOMs till cutoff, looking for a dominating test
  1338       // Now search up IDOMs till cutoff, looking for a dominating test
  1323       Node *prevdom = n;
  1339       Node *prevdom = n;
  1324       Node *dom = idom(prevdom);
  1340       Node *dom = idom(prevdom);
  1325       while (dom != cutoff) {
  1341       while (dom != cutoff) {
  1326         if (dom->req() > 1 && dom->in(1) == bol && prevdom->in(0) == dom) {
  1342         if (dom->req() > 1 && dom->in(1) == bol && prevdom->in(0) == dom) {
       
  1343           // It's invalid to move control dependent data nodes in the inner
       
  1344           // strip-mined loop, because:
       
  1345           //  1) break validation of LoopNode::verify_strip_mined()
       
  1346           //  2) move code with side-effect in strip-mined loop
       
  1347           // Move to the exit of outer strip-mined loop in that case.
       
  1348           Node* out_le = is_inner_of_stripmined_loop(dom);
       
  1349           if (out_le != NULL) {
       
  1350             prevdom = out_le;
       
  1351           }
  1327           // Replace the dominated test with an obvious true or false.
  1352           // Replace the dominated test with an obvious true or false.
  1328           // Place it on the IGVN worklist for later cleanup.
  1353           // Place it on the IGVN worklist for later cleanup.
  1329           C->set_major_progress();
  1354           C->set_major_progress();
  1330           dominated_by(prevdom, n, false, true);
  1355           dominated_by(prevdom, n, false, true);
  1331 #ifndef PRODUCT
  1356 #ifndef PRODUCT