RFR: 8285793: C2: optimization of mask checks in counted loops fail in the presence of cast nodes

Roland Westrelin roland at openjdk.java.net
Thu Apr 28 09:50:14 UTC 2022


This showed up when working with a panama micro benchmark. Optimization of:

if ((base + (offset << 2)) & 3) != 0) {
}

into:

if ((base & 3) != 0) {

fails if the subgraph contains cast nodes.

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

Commit messages:
 - whitespace
 - fix & test

Changes: https://git.openjdk.java.net/jdk/pull/8447/files
 Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=8447&range=00
  Issue: https://bugs.openjdk.java.net/browse/JDK-8285793
  Stats: 158 lines in 2 files changed: 154 ins; 0 del; 4 mod
  Patch: https://git.openjdk.java.net/jdk/pull/8447.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/8447/head:pull/8447

PR: https://git.openjdk.java.net/jdk/pull/8447


More information about the hotspot-compiler-dev mailing list