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

Johannes Graham duke at openjdk.org
Fri Jan 31 16:47:29 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 34 commits:

 - Merge branch 'openjdk:master' into xor_const
 - move template def to header
 - retry templated tests
 - fix int size
 - dedup test code
 - template calc_xor_max
 - clean up comments
 - add missed test file
 - extract static methods for testing; add GTESTs; more extensive int ir tests; remove some ir tests for longs due to difficulty in applying constant clamping.
 - avoid MIN_VALUE in test
 - ... and 24 more: https://git.openjdk.org/jdk/compare/fcd5ebc7...5ee3a0cc

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

Changes: https://git.openjdk.org/jdk/pull/23089/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=23089&range=19
  Stats: 362 lines in 5 files changed: 312 ins; 29 del; 21 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