src/hotspot/share/opto/loopPredicate.cpp
changeset 48145 f913f6dba2d3
parent 47216 71c04702a3d5
child 49487 bde392011cd8
--- a/src/hotspot/share/opto/loopPredicate.cpp	Tue Nov 28 21:04:42 2017 +0530
+++ b/src/hotspot/share/opto/loopPredicate.cpp	Tue Nov 28 11:59:16 2017 +0100
@@ -515,8 +515,8 @@
     _visited(area), _invariant(area), _stack(area, 10 /* guess */),
     _clone_visited(area), _old_new(area)
   {
-    Node* head = _lpt->_head;
-    Node* entry = head->in(LoopNode::EntryControl);
+    LoopNode* head = _lpt->_head->as_Loop();
+    Node* entry = head->skip_strip_mined()->in(LoopNode::EntryControl);
     if (entry->outcnt() != 1) {
       // If a node is pinned between the predicates and the loop
       // entry, we won't be able to move any node in the loop that
@@ -801,6 +801,10 @@
     return false;
   }
 
+  if (head->is_OuterStripMinedLoop()) {
+    return false;
+  }
+
   CountedLoopNode *cl = NULL;
   if (head->is_valid_counted_loop()) {
     cl = head->as_CountedLoop();
@@ -812,7 +816,7 @@
       cl = NULL;
   }
 
-  Node* entry = head->in(LoopNode::EntryControl);
+  Node* entry = head->skip_strip_mined()->in(LoopNode::EntryControl);
   ProjNode *predicate_proj = NULL;
   // Loop limit check predicate should be near the loop.
   predicate_proj = find_predicate_insertion_point(entry, Deoptimization::Reason_loop_limit_check);
@@ -1007,6 +1011,8 @@
   }
 #endif
 
+  head->verify_strip_mined(1);
+
   return hoisted;
 }