RFR: 8346664: C2: Optimize mask check with constant offset [v4]
Matthias Ernst
duke at openjdk.org
Thu Jan 23 10:35:52 UTC 2025
On Thu, 23 Jan 2025 10:04:33 GMT, Emanuel Peter <epeter at openjdk.org> wrote:
>> Matthias Ernst has updated the pull request incrementally with two additional commits since the last revision:
>>
>> - JLS: only the lower bits of the shift are taken into account (aka we don't assert).
>> - (c)
>
> test/hotspot/jtreg/compiler/c2/irTests/TestShiftAndMask.java line 180:
>
>> 178: @IR(counts = { IRNode.ADD_I, "1", IRNode.LSHIFT_I, "1" })
>> 179: public static int addShiftPlusConstOverlyLargeShift(int i, int j) {
>> 180: return (j + i << 129) & 32; // NOT transformed, only lower 5 bits of shift count.
>
> Can we have a test where both the shift and the mask are completely random values, and do result verification?
Respectfully, my time is also not infinite. This test suite was acceptable in 2022 with constants 2 and 3, and I'm merely extending the test with another branch that was overlooked. I've already randomized everything at your request, can we leave this to another iteration?
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/22856#discussion_r1926746997
More information about the hotspot-compiler-dev
mailing list