RFR: 8322077: Add Ideal transformation: (~a) | (~b) => ~(a & b) [v12]

Tobias Hartmann thartmann at openjdk.org
Wed Jan 10 07:33:31 UTC 2024


On Tue, 9 Jan 2024 17:23:58 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 with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains 18 additional commits since the last revision:
> 
>  - update copyright dates.
>  - Merge branch 'andnode-PNewDeMorganLawAndToOr' into ornode-PNewDeMorganLawOrToAnd
>  - Revert "adapt changes from the dependent pr."
>    
>    This reverts commit 0c8d10776fe55a28ea9f60160b4f6f57aabad5ab.
>  - Revert "adapt to new changes from the dependant pr."
>    
>    This reverts commit b21e242b306d9cf01e1ba84ebba47ef5b471d98e.
>  - adapt to new changes from the dependant pr.
>  - Merge branch 'andnode-PNewDeMorganLawAndToOr' into ornode-PNewDeMorganLawOrToAnd
>  - adapt changes from the dependent pr.
>  - Merge branch 'andnode-PNewDeMorganLawAndToOr' into ornode-PNewDeMorganLawOrToAnd
>  - Update test/hotspot/jtreg/compiler/c2/irTests/DeMorganLawLongTests.java
>    
>    Co-authored-by: Tobias Hartmann <tobias.hartmann at oracle.com>
>  - Update test/hotspot/jtreg/compiler/c2/irTests/DeMorganLawIntTests.java
>    
>    Co-authored-by: Tobias Hartmann <tobias.hartmann at oracle.com>
>  - ... and 8 more: https://git.openjdk.org/jdk/compare/f2cd45d6...dc60a548

Marked as reviewed by thartmann (Reviewer).

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

PR Review: https://git.openjdk.org/jdk/pull/16334#pullrequestreview-1812568240


More information about the hotspot-compiler-dev mailing list