RFR: 8347645: C2: XOR bounded value handling blocks constant folding [v12]
Johannes Graham
duke at openjdk.org
Thu Jan 30 23:49:49 UTC 2025
On Thu, 30 Jan 2025 23:08: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.
>
> Johannes Graham has updated the pull request incrementally with one additional commit since the last revision:
>
> extract static methods for testing; add GTESTs; more extensive int ir tests; remove some ir tests for longs due to difficulty in applying constant clamping.
By narrowing down the scope of my testable static method, I've now managed to write some gttests that exercise the most mysterious part of the code. I've also built up more in the IR tests - probably to the point where they have become too complicated, and have significant overlap with the gtests. So my feeling is that the IR tests could be thinned out, but some other opinions would be good.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/23089#issuecomment-2625955030
More information about the hotspot-compiler-dev
mailing list