-
Notifications
You must be signed in to change notification settings - Fork 5.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
8292602: ZGC: C2 late barrier analysis uses invalid dominator information #10353
Conversation
…print domination information in IGV graphs
👋 Welcome back rcastanedalo! A progress list of the required criteria for merging this PR into |
@robcasloz The following label will be automatically applied to this pull request:
When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing list. If you would like to change these labels, use the /label pull request command. |
/label add hotspot-gc |
@robcasloz |
/contributor add @neliasso |
@robcasloz |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me.
@robcasloz This change now passes all automated pre-integration checks. ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details. After integration, the commit message for the final commit will be:
You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed. At the time when this comment was updated there had been 80 new commits pushed to the
As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details. ➡️ To integrate this PR with the above commit message to the |
Thanks for reviewing, Vladimir! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me.
|
/integrate |
Going to push as commit eec992c.
Your commit was automatically rebased without conflicts. |
@robcasloz Pushed as commit eec992c. 💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored. |
Late ZGC barrier analysis (
ZBarrierSetC2::analyze_dominating_barriers()
) uses dominator information to elide unnecessary load barriers. This information is invalidated whenever the block ordering phase (PhaseCFG::fixup_flow()
) inserts a new block (PhaseCFG::insert_goto_at()
).This changeset updates the dominator information phase after each goto-block insertion in
insert_goto_at()
, to ensure that late ZGC barrier analysis works correctly. Domination information is encoded in twoBlock
member variables:_idom
and_dom_depth
. The immediate dominator (_idom
) of the new goto-block (block
) and its successor (out
) are trivially remapped after the insertion ofblock
, whereas the dominator tree depth (_dom_depth
) of theout
subtree is updated by a depth-first search of the descendants ofout
.Additionally, the changeset adds dominator tree checks (
PhaseCFG::verify_dominator_tree()
) every timePhaseCFG::verify()
is called and also at the end of theblockOrdering
phase (whereinsert_goto_at()
might be called); and includes dominator information in IGV graphs for ease of debugging.Alternative Solutions
An alternative solution would be to rebuild the dominator tree before using dominator information in ZGC's late barrier analysis. The alternative has been explored and found to be more complex than this changeset, as
PhaseCFG::build_dominator_tree()
makes multiple assumptions on the shape of the Ideal graph that do not hold at a later C2 phase.Another alternative would be to update the dominator tree only if ZGC, the only late consumer of domination information, is enabled. This changeset proposes updating the dominator tree unconditionally for simplicity, uniformity, and better test coverage. The overhead of doing so is insignificant for the main standard benchmark suites (DaCapo, SPECjbb2005, SPECjvm2008, SPECjbb2015, ...). A closer study of the DaCapo benchmarks shows that, on average,
insert_goto_at()
is called less than once per C2 compilation, and each call traverses less than 1% of the total blocks in the CFG.Testing
insert_goto_at()
by comparing them with the result of an independent dominator construction implementation (based on Python's NetworkX package).Thanks to Nils Eliasson for finding the issue and providing an initial fix.
Progress
Issue
Reviewers
Contributors
<neliasso@openjdk.org>
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk pull/10353/head:pull/10353
$ git checkout pull/10353
Update a local copy of the PR:
$ git checkout pull/10353
$ git pull https://git.openjdk.org/jdk pull/10353/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 10353
View PR using the GUI difftool:
$ git pr show -t 10353
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/10353.diff