8375442: C2: Notify nodes that inspect the graph deeply of changes far away during IGVN#29721
8375442: C2: Notify nodes that inspect the graph deeply of changes far away during IGVN#29721krk wants to merge 1 commit intoopenjdk:masterfrom
Conversation
…r away during IGVN
|
👋 Welcome back krk! A progress list of the required criteria for merging this PR into |
|
❗ This change is not yet ready to be integrated. |
I don't understand this part. If the verification succeeds, it means there should be no transformation performed by |
Some C2 IGVN node types inspect the graph far beyond their direct inputs (walking dominator chains, memory chains, or control flow) and miss optimization opportunities when changes happen far away. The affected types are
If/RangeCheck,Load,CmpPwith oop pointers, andCountedLoopEnd/LongCountedLoopEnd.This patch adds a deep revisit pass that, after the main IGVN worklist drains, re-enqueues all live deep-inspection nodes for re-evaluation, repeating until convergence or a maximum of 10 rounds.
Existing
Load/CmpPvalue-verification exceptions are tightened to only apply when deep revisit was not performed. The Ideal-verification exceptions forIf,RangeCheck,Load,CountedLoopEnd, andLongCountedLoopEndare not tightened becauseIdeal(can_reshape=true)is destructive and contaminates subsequent verification. These are instead verified via a drain-based convergence check inverify_optimize().A new
developflagUseDeepIGVNRevisit(default true) gates the feature.The new test covers RangeCheck elimination only; the other node types tend to trigger in larger methods.
Benchmark
On the Renaissance 0.16.1
dottybenchmark (Scala compiler, 10 repetitions), deep revisit showed a ~12% wall_time improvement and ~3% reduction in CPU cycles, measured with Performance Optimizer Observation Platform. Deep revisit triggered in 496 compilations, removing 12493 nodes total.Please note that this was measured on a noisy laptop with 3 runs.
UseDeepIGVNRevisitwas temporarily promoted to a product flag for this benchmark so it could be toggled on a release build:Progress
Issue
Reviewing
Using
gitCheckout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/29721/head:pull/29721$ git checkout pull/29721Update a local copy of the PR:
$ git checkout pull/29721$ git pull https://git.openjdk.org/jdk.git pull/29721/headUsing Skara CLI tools
Checkout this PR locally:
$ git pr checkout 29721View PR using the GUI difftool:
$ git pr show -t 29721Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/29721.diff
Using Webrev
Link to Webrev Comment