--- old/src/share/vm/opto/loopnode.hpp 2017-03-03 15:48:32.516436025 +0100 +++ new/src/share/vm/opto/loopnode.hpp 2017-03-03 15:48:32.442435979 +0100 @@ -72,7 +72,8 @@ HasAtomicPostLoop=4096, HasRangeChecks=8192, IsMultiversioned=16384, - StripMined=32768}; + StripMined=32768, + StripMinedShortCloned=65536}; char _unswitch_count; enum { _unswitch_max=3 }; char _postloop_flags; @@ -92,6 +93,7 @@ void set_partial_peel_loop() { _loop_flags |= PartialPeelLoop; } uint partial_peel_has_failed() const { return _loop_flags & PartialPeelFailed; } uint is_strip_mined() const { return _loop_flags & StripMined; } + uint is_strip_mined_short_cloned() const { return _loop_flags & StripMinedShortCloned; } void mark_partial_peel_failed() { _loop_flags |= PartialPeelFailed; } void mark_has_reductions() { _loop_flags |= HasReductions; } @@ -104,6 +106,7 @@ void mark_is_multiversioned() { _loop_flags |= IsMultiversioned; } void mark_strip_mined() { _loop_flags |= StripMined; } void clear_strip_mined() { _loop_flags &= ~StripMined; } + void mark_strip_mined_short_cloned() { _loop_flags |= StripMinedShortCloned; } int unswitch_max() { return _unswitch_max; } int unswitch_count() { return _unswitch_count; } @@ -459,6 +462,11 @@ // if the current round of loop opts should stop. bool iteration_split_impl( PhaseIdealLoop *phase, Node_List &old_new ); + // If profiling shows an inner strip mined loop runs for few + // iterations, make a copy without the outer strip mined loop and + // the safepoint + bool copy_strip_mined_short(PhaseIdealLoop *phase, Node_List &old_new); + // Given dominators, try to find loops with calls that must always be // executed (call dominates loop tail). These loops do not need non-call // safepoints (ncsfpt).