RFR: 8322077: Add Ideal transformation: (~a) | (~b) => ~(a & b) [v11]
Zhiqiang Zang
duke at openjdk.org
Tue Jan 9 06:06:51 UTC 2024
> 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 14 additional commits since the last revision:
- 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>
- Add tests for using De Morgan's Law for both optimizations.
- remove unused code from tests.
- update the copyright dates.
- address comments.
- ... and 4 more: https://git.openjdk.org/jdk/compare/851dbbb1...b21e242b
-------------
Changes:
- all: https://git.openjdk.org/jdk/pull/16334/files
- new: https://git.openjdk.org/jdk/pull/16334/files/0c8d1077..b21e242b
Webrevs:
- full: https://webrevs.openjdk.org/?repo=jdk&pr=16334&range=10
- incr: https://webrevs.openjdk.org/?repo=jdk&pr=16334&range=09-10
Stats: 38 lines in 5 files changed: 15 ins; 16 del; 7 mod
Patch: https://git.openjdk.org/jdk/pull/16334.diff
Fetch: git fetch https://git.openjdk.org/jdk.git pull/16334/head:pull/16334
PR: https://git.openjdk.org/jdk/pull/16334
More information about the hotspot-compiler-dev
mailing list