src/hotspot/share/opto/loopopts.cpp
changeset 50248 c0475f9c1c45
parent 50180 ffa644980dff
child 50503 f07979db6cb2
--- a/src/hotspot/share/opto/loopopts.cpp	Thu May 24 13:34:31 2018 +0530
+++ b/src/hotspot/share/opto/loopopts.cpp	Thu May 24 09:59:57 2018 +0200
@@ -1667,6 +1667,18 @@
         continue;
       }
 
+      // If use is referenced through control edge... (idx == 0)
+      if (mode == IgnoreStripMined && idx == 0) {
+        LoopNode *head = loop->_head->as_Loop();
+        if (head->is_strip_mined() && is_dominator(head->outer_loop_exit(), prev)) {
+          // That node is outside the inner loop, leave it outside the
+          // outer loop as well to not confuse verification code.
+          assert(!loop->_parent->is_member(use_loop), "should be out of the outer loop");
+          _igvn.replace_input_of(use, 0, head->outer_loop_exit());
+          continue;
+        }
+      }
+
       while(!outer_loop->is_member(get_loop(cfg))) {
         prev = cfg;
         cfg = cfg->_idx >= new_counter ? cfg->in(2) : idom(cfg);