< prev index next >

src/hotspot/share/opto/loopPredicate.cpp

Print this page

        

@@ -513,12 +513,12 @@
   Invariance(Arena* area, IdealLoopTree* lpt) :
     _lpt(lpt), _phase(lpt->_phase),
     _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
       // depends on it above it in a predicate. Mark all those nodes
       // as non loop invariatnt.

@@ -799,10 +799,14 @@
   if (head->unique_ctrl_out()->Opcode() == Op_NeverBranch) {
     // do nothing for infinite loops
     return false;
   }
 
+  if (head->Opcode() == Op_Loop && head->is_strip_mined()) {
+    return false;
+  }
+
   CountedLoopNode *cl = NULL;
   if (head->is_valid_counted_loop()) {
     cl = head->as_CountedLoop();
     // do nothing for iteration-splitted loops
     if (!cl->is_normal_loop()) return false;

@@ -810,11 +814,11 @@
     BoolTest::mask bt = cl->loopexit()->test_trip();
     if (bt != BoolTest::lt && bt != BoolTest::gt)
       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);
   if (predicate_proj != NULL)
     entry = predicate_proj->in(0)->in(0);

@@ -1005,10 +1009,12 @@
     tty->print("Loop Predication Performed:");
     loop->dump_head();
   }
 #endif
 
+  head->verify_strip_mined(1);
+
   return hoisted;
 }
 
 //------------------------------loop_predication--------------------------------
 // driver routine for loop predication optimization
< prev index next >