RFR: 8347645: C2: XOR bounded value handling blocks constant folding [v7]
Johannes Graham
duke at openjdk.org
Mon Jan 27 19:40:02 UTC 2025
On Mon, 27 Jan 2025 08:19:02 GMT, Emanuel Peter <epeter at openjdk.org> wrote:
>> test/hotspot/jtreg/compiler/c2/irTests/XorLNodeIdealizationTests.java line 39:
>>
>>> 37: private static final long CONST_1 = RunInfo.getRandom().nextLong();
>>> 38: private static final long CONST_2 = RunInfo.getRandom().nextLong();
>>> 39: private static final long CONST_POW_2 = Math.abs(1L << RunInfo.getRandom().nextInt());
>>
>> Can you please use our new `Generators.java`? I'll explain why:
>>
>> Sampling random powers-of-2, or values near powers-of-2 is very very rare with longs. There are about 64 powers-of-2 in a set of `2^64`, so the odds are really really bad. The sampler in `Generators.java` has a bias to pick more powers-of-2 and values nearby.
>
> And we need values nearby powers of 2, as your examples show ;)
Will update to use `Generators`. Should I update the existing randoms to use it as well, or just for the ones I'm adding?
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/23089#discussion_r1931090318
More information about the hotspot-compiler-dev
mailing list