RFR: 8347459: C2: missing transformation for chain of shifts/multiplications by constants [v6]
Marc Chevalier
duke at openjdk.org
Fri Mar 7 16:11:36 UTC 2025
On Fri, 7 Mar 2025 13:52:14 GMT, Emanuel Peter <epeter at openjdk.org> wrote:
>> I can also do that, but I think using the constants is more valuable than only random numbers: most of random int or long won't have some corner properties I try to cover here. On top of that, with the comments, they help enumerating clearly different cases to look at. So, I'd be happy to add some randomization, but I strongly feel I should keep the constant ones as well.
>
> 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?
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/23728#discussion_r1985333230
More information about the hotspot-compiler-dev
mailing list