--- old/src/hotspot/share/opto/ifnode.cpp 2017-10-03 11:50:00.164514955 +0200 +++ new/src/hotspot/share/opto/ifnode.cpp 2017-10-03 11:49:59.117515787 +0200 @@ -117,6 +117,7 @@ // No intervening control, like a simple Call Node *r = iff->in(0); if( !r->is_Region() ) return NULL; + if (r->is_Loop() && r->in(LoopNode::LoopBackControl)->is_top()) return NULL; // going away anyway if( phi->region() != r ) return NULL; // No other users of the cmp/bool if (b->outcnt() != 1 || cmp->outcnt() != 1) { @@ -1618,6 +1619,16 @@ // whether they are testing a 'gt' or 'lt' condition. The 'gt' condition // happens in count-down loops if (iff->is_CountedLoopEnd()) return NULL; + Node* proj_true = iff->proj_out(true); + if (proj_true->outcnt() == 1) { + Node* c = proj_true->unique_out(); + // Leave test of outer strip mined loop alone + if (c != NULL && c->is_Loop() && + c->in(LoopNode::LoopBackControl) == proj_true && + c->as_Loop()->is_strip_mined()) { + return NULL; + } + } if (!iff->in(1)->is_Bool()) return NULL; // Happens for partially optimized IF tests BoolNode *b = iff->in(1)->as_Bool(); BoolTest bt = b->_test;