RFR: 8346664: C2: Optimize mask check with constant offset [v2]
Emanuel Peter
epeter at openjdk.org
Thu Jan 23 08:05:53 UTC 2025
On Mon, 20 Jan 2025 08:16:42 GMT, Matthias Ernst <duke at openjdk.org> wrote:
>> test/hotspot/jtreg/compiler/c2/irTests/TestShiftAndMask.java line 592:
>>
>>> 590: int i = RANDOM.nextInt((Integer.MAX_VALUE - 1) >> INT_MASK_WIDTH);
>>> 591: int j = RANDOM.nextInt((Integer.MAX_VALUE - 1) >> INT_MASK_WIDTH);
>>> 592: long res = addShiftConvMaskCheckIndex2(i, j, (Integer.max(i, j) << INT_MASK_WIDTH) + 1);
>>
>> I wonder if it would make sense to keep the old tests, and just add new ones with random constants. That way if we mess up with the new changes, we would at least still have the old ones catching us.
>
> I'll let you decide - but I do find the combinatorial of {int, long, i2l} x {const, nonconst mask} x {left, right} x {+shift, +const} pretty unwieldy already, duplicating the tests once more would just be piling on.
>
> I could move the randomized tests to a new file name, keep the old as is, and once you have sufficient confidence, you delete the old ones? I don't see they can be maintained in parallel for long.
Hmm, ok never mind. Let's keep it with just the randomized tests here. I think it is ok.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/22856#discussion_r1926525753
More information about the hotspot-compiler-dev
mailing list