RFR: 8267399: C2: java/text/Normalizer/ConformanceTest.java test failed with assertion [v2]

Roland Westrelin roland at openjdk.java.net
Tue Jun 15 09:30:08 UTC 2021


On Tue, 15 Jun 2021 08:47:01 GMT, Roland Westrelin <roland at openjdk.org> wrote:

>> src/hotspot/share/opto/loopTransform.cpp line 2858:
>> 
>>> 2856:   bool upward = cl->stride_con() > 0;
>>> 2857:   main_limit = new CastIINode(main_limit, TypeInt::make(upward ? min_jint : orig_limit_t->_lo,
>>> 2858:                                                         upward ? orig_limit_t->_hi : max_jint, Type::WidenMax));
>> 
>> First, need comment.
>> Second, why you used min_jint and max_jint instead of main_limit->_lo and main_limit->_hi?
>
> Thanks for the reviewing this.
> 
>> Second, why you used min_jint and max_jint instead of main_limit->_lo and main_limit->_hi?
> 
> Range check elimination changes the main loop's limit. For a loop going up, the new limit is less or equal to the initial limit. So it's less than main_limit->_hi. But it's not guaranteed to be greater or equal to main_limit->_lo. Say, main_limit is a constant, then main_limit->_lo = main_limit->_hi. The new limit can't be >= main_limit->_lo otherwise the new limit is main_limit->_lo = main_limit->_hi and the limit is unchanged.

> First, need comment.

Comment added.

-------------

PR: https://git.openjdk.java.net/jdk/pull/4388


More information about the hotspot-compiler-dev mailing list