RFR: 8347645: C2: XOR bounded value handling blocks constant folding [v27]
Johannes Graham
duke at openjdk.org
Thu Feb 13 19:44:18 UTC 2025
On Thu, 13 Feb 2025 08:57:01 GMT, Emanuel Peter <epeter at openjdk.org> wrote:
>> Johannes Graham has updated the pull request incrementally with one additional commit since the last revision:
>>
>> formatting, remove commented tests
>
> src/hotspot/share/opto/addnode.cpp line 1010:
>
>> 1008: if( r0 == TypeInt::BOOL && ( r1 == TypeInt::ONE
>> 1009: || r1 == TypeInt::BOOL))
>> 1010: return TypeInt::BOOL;
>
> It looks to me like this case should be covered by `calc_xor_max` below. Do we have any IR tests that verify that this still gets optimized as before?
Yes - it's essentially the 1-bit case of the more general function. I have some IR tests for it in XorINodeIdealizationTests - `testConstXorBool` and `testXorSelfBool`. I'll add another one.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/23089#discussion_r1955115122
More information about the hotspot-compiler-dev
mailing list