RFR: 8357982: Fix several failing BMI tests with -XX:+UseAPX [v2]

Jatin Bhateja jbhateja at openjdk.org
Tue Jun 3 17:49:37 UTC 2025


On Tue, 3 Jun 2025 02:43:42 GMT, Jatin Bhateja <jbhateja at openjdk.org> wrote:

>> Jatin Bhateja has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Review comments resolutions
>
> Thanks,  encoding logic is concentrated in integral instruction tests and is shared with corresponding long variants, extended APX coverage for BLS/R/MSK.

> @jatin-bhateja Thanks for looking into this!
> 
> `predicate(!UseAPX && n->in(2)->bottom_type()->is_int()->get_con() != -1);`
> 
> The PR title seems to suggest the bug is only about -XX:+UseAPX. Why are you changing things for the case !UseAPX?
> 
> Are these not cases like a ^ -1, which basically flips all bits. What alternative does this end up using now?
> 
> A code comment would be helpful.

We are tightening the predicate check so that under no circumstances we pick this pattern during the reduction phase of instruction selection on account of having lower cost. There is a generic pattern (xorI_rReg_imm) for all integral immediate values, and then there is a special pattern for Xor with -1 (fxorI_rReg_im1), which is needed for AndN inferencing.

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

PR Comment: https://git.openjdk.org/jdk/pull/25501#issuecomment-2936412986


More information about the hotspot-compiler-dev mailing list