RFR: 8311932: Suboptimal compiled code of nested loop over memory segment [v4]
Christian Hagedorn
chagedorn at openjdk.org
Thu Nov 16 07:14:29 UTC 2023
On Wed, 15 Nov 2023 15:54:46 GMT, Roland Westrelin <roland at openjdk.org> wrote:
>> To enable the elimination of long range checks, the loop that contains
>> the range checks is transformed into a loop nest and the range checks
>> are changed to operate on int values computed before the loop is
>> entered. This causes extra overhead out of loop and once, the range
>> checks are eliminated, can only pay off if the loop is executed for
>> long enough. This change disable the transformation if the trip count
>> computed from profile data is too low. This came up with a
>> MemorySegment API micro benchmarks and improves performance
>> significantly.
>
> Roland Westrelin has updated the pull request incrementally with one additional commit since the last revision:
>
> review
src/hotspot/share/opto/loopnode.cpp line 861:
> 859: if (range_checks.size() > 0) {
> 860: // This transformation requires peeling one iteration. Also, if it has range checks and they are eliminated by
> 861: // Loop Predication, then 2 Hoisted Check Predicates are added for one range check. Finally, transforming a long range check requires
Just noticed that the line wraps are off now - maybe you want to re-wrap these lines. But that's just a minor detail.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/16650#discussion_r1395239007
More information about the hotspot-compiler-dev
mailing list