8366117: Shenandoah: Notify barrier nodes when transitive inputs change during IGVN#29491
Open
krk wants to merge 6 commits intoopenjdk:masterfrom
Open
8366117: Shenandoah: Notify barrier nodes when transitive inputs change during IGVN#29491krk wants to merge 6 commits intoopenjdk:masterfrom
krk wants to merge 6 commits intoopenjdk:masterfrom
Conversation
|
👋 Welcome back krk! A progress list of the required criteria for merging this PR into |
|
❗ This change is not yet ready to be integrated. |
Webrevs
|
JohnTortugo
suggested changes
Feb 6, 2026
| if (u->Opcode() == Op_ShenandoahLoadReferenceBarrier) { | ||
| worklist.push(u); | ||
| } else if (is_barrier_traversal_node(u->Opcode())) { | ||
| enqueue_dependent_gc_barriers_helper(worklist, visited, u); |
Contributor
There was a problem hiding this comment.
I'd prefer if you used a Stack instead of recursion here.
JohnTortugo
approved these changes
Feb 19, 2026
Author
|
Hi! Could I get a review on this one? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ShenandoahLoadReferenceBarrierNode::Identity()determines if a barrier can be eliminated by traversing through intermediate nodes (Phi,DecodeN,CastPP, etc.) vianeeds_barrier_impl(). When these intermediate nodes change during IGVN, the barrier is not re-evaluated because IGVN only notifies direct users. This causesTestVerifyIterativeGVNto fail with Shenandoah, reporting missed optimization opportunities.This fix adds a
BarrierSetC2::enqueue_dependent_gc_barriers()virtual method that Shenandoah overrides to traverse outputs through the same node types and enqueue dependent barriers for re-evaluation.There are more barrier eliminations enabled with this, e.g. in the arbitrarily chosen scrabble of renaissance benchmarks:
This requires uncommenting prints with
optimize barrierinc2/shenandoahSupport.cpp.Also tested with
make test CONF=linux-x86_64-server-fastdebug TEST=compiler/c2/TestVerifyIterativeGVN.java JTREG="VM_OPTIONS=-XX:+UseShenandoahGC -Xcomp -Xbatch -XX:-TieredCompilation"which passes with the fix and fails without.Progress
Issue
Reviewers
Reviewing
Using
gitCheckout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/29491/head:pull/29491$ git checkout pull/29491Update a local copy of the PR:
$ git checkout pull/29491$ git pull https://git.openjdk.org/jdk.git pull/29491/headUsing Skara CLI tools
Checkout this PR locally:
$ git pr checkout 29491View PR using the GUI difftool:
$ git pr show -t 29491Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/29491.diff
Using Webrev
Link to Webrev Comment