RFR: 8347645: C2: XOR bounded value handling blocks constant folding

Emanuel Peter epeter at openjdk.org
Wed Jan 22 07:46:35 UTC 2025


On Tue, 14 Jan 2025 18:12:27 GMT, Johannes Graham <duke at openjdk.org> wrote:

>> C2 does not eliminate XOR nodes with constant arguments. This has a noticeable effect on `Long.expand` with a constant mask, on architectures that don't have instructions equivalent  to `PDEP` to be used in an intrinsic.
>> 
>> This patch demonstrates a potential fix to the problem, but there might well be better ways to do it.
>
> Thanks for creating the bug.
> 
> I have left the x ^x =0 check in Value because it was operating on the Node rather than the Type. I moved the rest into add_ring.
> 
> Done for Int, Long to follow.

@j3graham Since this is a performance improvement: do you have any benchmark that shows a speedup?

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

PR Comment: https://git.openjdk.org/jdk/pull/23089#issuecomment-2606507171


More information about the hotspot-compiler-dev mailing list