RFR: 8369435: C2: transform (LShiftX (SubX con0 a), con1) into (SubX con0<<con1 (LShiftX a con1))

Roland Westrelin roland at openjdk.org
Thu Oct 16 09:42:54 UTC 2025


We already transform:

(LShiftX (AddX a con0), con1) into (AddX (LShiftX a con1) con0<<con1)

THis is a variant with SubX. I found that this helps RCE.

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

Commit messages:
 - test & fix

Changes: https://git.openjdk.org/jdk/pull/27842/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=27842&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8369435
  Stats: 250 lines in 5 files changed: 150 ins; 98 del; 2 mod
  Patch: https://git.openjdk.org/jdk/pull/27842.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/27842/head:pull/27842

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


More information about the hotspot-compiler-dev mailing list