RFR: 8323220: Reassociate loop invariants involved in Cmps and Add/Subs [v3]
Joshua Cao
duke at openjdk.org
Tue Jan 23 22:01:26 UTC 2024
On Tue, 23 Jan 2024 15:15:47 GMT, Emanuel Peter <epeter at openjdk.org> wrote:
>> [notEqualsInvariantSubVariantLong.txt](https://github.com/openjdk/jdk/files/14015703/notEqualsInvariantSubVariantLong.txt)
>>
>> Attaching the IdealGraphVisualizer file (renamed to `.txt` cause GitHub wants that).
>>
>> When we use `Argument.NUMBER_42`, we can avoid generating traps. When `i == 0` we enter the if statement, otherwise we exit.
>>
>> If we use random numbers, we most likely never enter the if statement so we can generate a trap there. In this case, the trap block as an extra `SubL` for `inv1 - i`.
>
> @caojoshua I see. That is a sad limitation. You could now add a `@Run` statement, but that is overkill as well. I hope to improve the IR framework to make it a bit easier to pass better arguments soon. For now I think we could just leave it with constants, for simplicity.
> Can you randomize just one value and use them for both inv1 and inv2?
Yeah we can just take a single argument `inv1`. I'd prefer having two arguments and leaving them constant.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/17375#discussion_r1464045674
More information about the hotspot-compiler-dev
mailing list