RFR: 8261008: Optimize Xor [v2]
Eric Liu
github.com+10482586+therealeliu at openjdk.java.net
Thu Mar 4 13:26:41 UTC 2021
On Wed, 3 Mar 2021 14:32:45 GMT, Tobias Hartmann <thartmann at openjdk.org> wrote:
>>> `x - x` is already optimized: https://github.com/openjdk/jdk/blob/master/src/hotspot/share/opto/subnode.cpp#L96
>>> `x | x` - here: https://github.com/openjdk/jdk/blob/master/src/hotspot/share/opto/addnode.cpp#L781
>>>
>>> For `x ^ x` Value() method should be used as for SubNode.
>>
>> Thanks for your review. I moved those codes into `Value()` and will update after some tests finished.
>
> I think C2 optimizations could lead to IR shapes containing that pattern even if the Java source code does not. In any case, such simple patterns should be optimized and as Vladimir mentioned, it should be a `::Value` optimization.
Please help to review the new commit.
All jtreg tests passed without new failure.
-------------
PR: https://git.openjdk.java.net/jdk/pull/2776
More information about the hotspot-compiler-dev
mailing list