RFR: 8255000: C2: Unify IGVN processing when loop opts are over

Vladimir Ivanov vlivanov at openjdk.java.net
Mon Oct 19 20:40:23 UTC 2020


There is a number of use cases when ideal nodes (either individual or even the whole classes) delay some
transformations until loop optimizations are over.

Unfortunately, there are multiple solutions in the code base with their pros and cons: either a custom per-node class
logic (e.g., for range check dependent `CastII` or `Opaque4` nodes) or `Compile::major_progress() == 0` as a signal
that loop opts are over.

I propose to introduce a unified approach to reliably process nodes that require (or may benefit from) IGVN pass once
loop opts are finally over and migrate existing use cases to it.

After some experimentation, I decided not to rely on `Compile::major_progress()` because:
  * it's hard to reason about its properties (there are many places where it is adjusted);
  * attempts to verify its monotonicity using asserts triggered too many sporadic failures.

So, I wasn't persuaded that `Compile::major_progress() == 0` is reliable enough and introduced a dedicated flag
(`Compile::post_loop_opts_phase()`) which signals that loop opts are over.

(The patch - 69a93d4 commit - is on top of 8255026 cleanup which is reviewed separately.)

Testing: tier1-tier5

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

Commit messages:
 - Unify post loop opts IGVN
 - 8255026: C2: Miscellaneous cleanups in Compile and PhaseIdealLoop code

Changes: https://git.openjdk.java.net/jdk/pull/751/files
 Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=751&range=00
  Issue: https://bugs.openjdk.java.net/browse/JDK-8255000
  Stats: 451 lines in 15 files changed: 111 ins; 156 del; 184 mod
  Patch: https://git.openjdk.java.net/jdk/pull/751.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/751/head:pull/751

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


More information about the shenandoah-dev mailing list