RFR: 8347459: C2: missing transformation for chain of shifts/multiplications by constants [v6]

Emanuel Peter epeter at openjdk.org
Fri Mar 7 16:18:58 UTC 2025


On Fri, 7 Mar 2025 16:08:43 GMT, Marc Chevalier <duke at openjdk.org> wrote:

>> Absolutely, please keep the cases you already have, and add some randomized cases on top of it.
>> 
>>> most of random int or long won't have some corner properties I try to cover here
>> 
>> Right, that's why it is better to use `Generators.java` rather than just `Random`. With `Generators`, we make sure to generate more special values, such as powers of 2. And powers of 2 multiplication can for example be converted to shift, and that seems to be quite relevant here ;)
>
> I've tried something but... It seems too easy. With this way of doing CON0 and CON1, we only test 1 pair of constants at each run, no? I thought about a loop to cover ranges, but then, it's not constants for the compiler.
> 
> So... is that how am I supposed to do? Just one pair, and the number of run of the same test will provide with time some coverage of the parameter space?

I think just one pair is good enough. This is more of a long-term test, that just fuzzes away every time its run. Such tests have a surprising coverage eventually.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/23728#discussion_r1985342871


More information about the hotspot-compiler-dev mailing list