--- old/src/hotspot/share/opto/loopPredicate.cpp 2017-10-03 11:50:01.437513943 +0200 +++ new/src/hotspot/share/opto/loopPredicate.cpp 2017-10-03 11:50:00.258514880 +0200 @@ -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->Opcode() == Op_Loop && head->is_strip_mined()) { + 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; }