RFR: 8347645: C2: XOR bounded value handling blocks constant folding [v3]

Johannes Graham duke at openjdk.org
Wed Jan 22 17:31:42 UTC 2025


> C2 does not eliminate XOR nodes with constant arguments. This has a noticeable effect on `Long.expand` with a constant mask, on architectures that don't have instructions equivalent  to `PDEP` to be used in an intrinsic.
> 
> This patch demonstrates a potential fix to the problem, but there might well be better ways to do it.

Johannes Graham has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 13 commits:

 - Merge branch 'openjdk:master' into xor_const
 - move tests, add correctness checks
 - Merge remote-tracking branch 'origin/xor_const' into xor_const
 - move logic from Value to add_node XorL
 - move logic from Value to add_node XorI
 - format, copyright date
 - xor const folding
 - test for xor const folding
 - move logic from Value to add_node XorL
 - move logic from Value to add_node XorI
 - ... and 3 more: https://git.openjdk.org/jdk/compare/b720517c...fdede511

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

Changes: https://git.openjdk.org/jdk/pull/23089/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=23089&range=02
  Stats: 233 lines in 3 files changed: 198 ins; 27 del; 8 mod
  Patch: https://git.openjdk.org/jdk/pull/23089.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/23089/head:pull/23089

PR: https://git.openjdk.org/jdk/pull/23089


More information about the hotspot-compiler-dev mailing list