# HG changeset patch # User vdeshpande # Date 1531167908 25200 # Node ID dd7ce84016a532cb10a4c6c0cc65232c5ffab4ee # Parent a926b7737d3b99d19ed636602e6e80259d35d86b 8194740: UseSubwordForMaxVector causes performance regression Reviewed-by: kvn, thartmann diff -r a926b7737d3b -r dd7ce84016a5 src/hotspot/share/opto/loopTransform.cpp --- a/src/hotspot/share/opto/loopTransform.cpp Mon Jul 09 11:15:55 2018 -0700 +++ b/src/hotspot/share/opto/loopTransform.cpp Mon Jul 09 13:25:08 2018 -0700 @@ -861,7 +861,9 @@ // Check for being too big if (body_size > (uint)_local_loop_unroll_limit) { - if ((UseSubwordForMaxVector || xors_in_loop >= 4) && body_size < (uint)LoopUnrollLimit * 4) return true; + if ((cl->is_subword_loop() || xors_in_loop >= 4) && body_size < (uint)LoopUnrollLimit * 4) { + return true; + } // Normal case: loop too big return false; } diff -r a926b7737d3b -r dd7ce84016a5 src/hotspot/share/opto/loopnode.hpp --- a/src/hotspot/share/opto/loopnode.hpp Mon Jul 09 11:15:55 2018 -0700 +++ b/src/hotspot/share/opto/loopnode.hpp Mon Jul 09 13:25:08 2018 -0700 @@ -75,7 +75,8 @@ HasRangeChecks=8192, IsMultiversioned=16384, StripMined=32768, - ProfileTripFailed=65536}; + SubwordLoop=65536, + ProfileTripFailed=131072}; char _unswitch_count; enum { _unswitch_max=3 }; char _postloop_flags; @@ -99,6 +100,7 @@ bool partial_peel_has_failed() const { return _loop_flags & PartialPeelFailed; } bool is_strip_mined() const { return _loop_flags & StripMined; } bool is_profile_trip_failed() const { return _loop_flags & ProfileTripFailed; } + bool is_subword_loop() const { return _loop_flags & SubwordLoop; } void mark_partial_peel_failed() { _loop_flags |= PartialPeelFailed; } void mark_has_reductions() { _loop_flags |= HasReductions; } @@ -112,6 +114,7 @@ void mark_strip_mined() { _loop_flags |= StripMined; } void clear_strip_mined() { _loop_flags &= ~StripMined; } void mark_profile_trip_failed() { _loop_flags |= ProfileTripFailed; } + void mark_subword_loop() { _loop_flags |= SubwordLoop; } int unswitch_max() { return _unswitch_max; } int unswitch_count() { return _unswitch_count; } diff -r a926b7737d3b -r dd7ce84016a5 src/hotspot/share/opto/superword.cpp --- a/src/hotspot/share/opto/superword.cpp Mon Jul 09 11:15:55 2018 -0700 +++ b/src/hotspot/share/opto/superword.cpp Mon Jul 09 13:25:08 2018 -0700 @@ -376,6 +376,7 @@ if (same_type) { max_vector = cur_max_vector; flag_small_bt = true; + cl->mark_subword_loop(); } } }