[lworld] RFR: 8376708: [lworld] Missed Ideal optimization around CmpL [v2]

Benoît Maillard bmaillard at openjdk.org
Fri Feb 20 10:46:26 UTC 2026


> This PR adresses a missed optimization in `CmpLNode::Ideal`. It occurs when when we encode a pointer comparison as `CmpL(OrL(left, right), 0L)` (which essentially translates to "both operands are null") during parsing in `do_acmp`, and this comparison can later be folded to a constant in `CmpLNode::Ideal` because one of the operands has a `NotNull` type. This optimization hides behind `can_reshape`, so it can only be carried out during IGVN and not during the initial GVN pass.  To fix this, we just need to make sure to add the compare to the worklist during parsing.
> 
> ### Testing
> - [x] GitHub Actions
> - [x] tier1-3, plus some internal testing
> 
> Thank you for reviewing!

Benoît Maillard has updated the pull request incrementally with one additional commit since the last revision:

  Missing IgnoreUnrecognizedVMOptions

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

Changes:
  - all: https://git.openjdk.org/valhalla/pull/2145/files
  - new: https://git.openjdk.org/valhalla/pull/2145/files/3041036d..90c7e12e

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=valhalla&pr=2145&range=01
 - incr: https://webrevs.openjdk.org/?repo=valhalla&pr=2145&range=00-01

  Stats: 2 lines in 1 file changed: 1 ins; 0 del; 1 mod
  Patch: https://git.openjdk.org/valhalla/pull/2145.diff
  Fetch: git fetch https://git.openjdk.org/valhalla.git pull/2145/head:pull/2145

PR: https://git.openjdk.org/valhalla/pull/2145


More information about the valhalla-dev mailing list