RFR: 8324751: C2 SuperWord: Aliasing Analysis runtime check [v6]

Manuel Hässig mhaessig at openjdk.org
Mon Aug 11 13:43:28 UTC 2025


On Mon, 11 Aug 2025 12:14:08 GMT, Manuel Hässig <mhaessig at openjdk.org> wrote:

>> Emanuel Peter has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Update test/hotspot/jtreg/compiler/loopopts/superword/TestAliasingFuzzer.java
>>   
>>   Co-authored-by: Manuel Hässig <manuel at haessig.org>
>
> src/hotspot/share/opto/vectorization.cpp line 752:
> 
>> 750: //     If stride < 0:
>> 751: //       k = (init - stride - 1) / abs(stride)
>> 752: //       last = MAX(init, init + k * stride)
> 
> Suggestion:
> 
> //   LAST(init, stride, limit)
> //     If stride > 0:
> //       k = (limit - init - 1) / abs(stride)
> //       last = MAX(init, init + k * stride)
> //     If stride < 0:
> //       k = (init - limit - 1) / abs(stride)
> //       last = MIN(init, init + k * stride)

Or to be a bit closer to the implementation:
Suggestion:

//   LAST(init, stride, limit)
//     c = stride > 0 ? 1 : -1;
//     k = (c * (limit - init) - 1) / abs(stride)
//     If stride > 0:
//       last = MAX(init, init + k * stride)
//     If stride < 0:
//       last = MIN(init, init + k * stride)

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

PR Review Comment: https://git.openjdk.org/jdk/pull/24278#discussion_r2266522715


More information about the hotspot-compiler-dev mailing list