RFR: 8322077: Add Ideal transformation: (~a) | (~b) => ~(a & b) [v8]
Tobias Hartmann
thartmann at openjdk.org
Mon Jan 8 08:40:26 UTC 2024
On Sat, 6 Jan 2024 00:44:07 GMT, Zhiqiang Zang <duke at openjdk.org> wrote:
>> Hello,
>>
>> (~a) | (~b) => ~(a & b) is a widely seen pattern, for example it is implemented for LLVM [here](https://github.com/llvm/llvm-project/blob/397f1ce9efb4eea1ee10fe4833f733b8c7abd878/llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp#L1617C28-L1617C28); however it is missing in current implementation of hotspot. This pull request adds this transformation and associated tests.
>>
>> Thanks.
>
> Zhiqiang Zang has updated the pull request incrementally with one additional commit since the last revision:
>
> Add tests for using De Morgan's Law for both optimizations.
Looks good to me otherwise.
test/hotspot/jtreg/compiler/c2/irTests/DeMorganLawIntTests.java line 31:
> 29: * @test
> 30: * @bug 8322077
> 31: * @summary Test that Ideal transformations on the De Morgan's Law performe
Suggestion:
* @summary Test that Ideal transformations on the De Morgan's Law perform
test/hotspot/jtreg/compiler/c2/irTests/DeMorganLawLongTests.java line 31:
> 29: * @test
> 30: * @bug 8322077
> 31: * @summary Test that Ideal transformations on the De Morgan's Law performe
Suggestion:
* @summary Test that Ideal transformations on the De Morgan's Law perform
-------------
Marked as reviewed by thartmann (Reviewer).
PR Review: https://git.openjdk.org/jdk/pull/16334#pullrequestreview-1808302290
PR Review Comment: https://git.openjdk.org/jdk/pull/16334#discussion_r1444279955
PR Review Comment: https://git.openjdk.org/jdk/pull/16334#discussion_r1444280127
More information about the hotspot-compiler-dev
mailing list