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

Johannes Graham duke at openjdk.org
Thu Jan 30 23:08:27 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 incrementally with one additional commit since the last revision:

  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.

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

Changes:
  - all: https://git.openjdk.org/jdk/pull/23089/files
  - new: https://git.openjdk.org/jdk/pull/23089/files/03fcdb1e..7ef5c5c7

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=23089&range=11
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=23089&range=10-11

  Stats: 240 lines in 4 files changed: 104 ins; 84 del; 52 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