RFR: 8367158: C2: create better fill and copy benchmarks, taking alignment into account
Emanuel Peter
epeter at openjdk.org
Wed Nov 26 06:53:53 UTC 2025
On Wed, 26 Nov 2025 06:25:33 GMT, Francesco Nigro <duke at openjdk.org> wrote:
>> test/micro/org/openjdk/bench/vm/compiler/VectorBulkOperationsArray.java line 155:
>>
>>> 153:
>>> 154: @CompilerControl(CompilerControl.Mode.INLINE)
>>> 155: public static int offsetLoad(int i) { return i % 64; }
>>
>> it's a minor but `& 63`: since i is not proven to be positive, C2 doesn't strength reduce the modulus into the cheaper form (&).
>> you can mask `i` stripping out the negative bits too, and should work the same.
>
> Same applies elsewhere in the bench
Good idea! Though I think in all call sites of `offsetLoad` we know that `i` is positive, so I suspect that this is already enough.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/27315#discussion_r2563547610
More information about the hotspot-compiler-dev
mailing list