-
Notifications
You must be signed in to change notification settings - Fork 5.7k
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
8317349: Randomize order of macro node expansion in C2 #17684
Conversation
👋 Welcome back dlunden! A progress list of the required criteria for merging this PR into |
Webrevs
|
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.
That's a nice stress option! I have a few comments.
src/hotspot/share/opto/macro.cpp
Outdated
@@ -2511,6 +2514,7 @@ bool PhaseMacroExpand::expand_macro_nodes() { | |||
} | |||
assert(!success || (C->macro_count() == (old_macro_count - 1)), "elimination must have deleted one node from macro list"); | |||
progress = progress || success; | |||
if (success) { C->print_method(PHASE_AFTER_MACRO_EXPANSION_ELIMINATE, 4, n); } |
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.
I suggest to put it on a new line.
if (success) { C->print_method(PHASE_AFTER_MACRO_EXPANSION_ELIMINATE, 4, n); } | |
if (success) { | |
C->print_method(PHASE_AFTER_MACRO_EXPANSION_ELIMINATE, 4, n); | |
} |
I think dumping at level 4 (same for the other newly added dumps) is too verbose already but when dumping at level 5, you have the overhead of additional IGVN step dumps. I could imagine that you either want macro expansion dumps OR IGVN step dumps but not always both. So, it looks like we've now reached a point where it would have been nice to enable/disable certain dumps.
Anyway, since this is not possible I suggest to move these dumps to level 5 for now. But I'm open for other opinions about that.
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.
I think we should also add this to eliminate_macro_nodes()
when eliminating locks, allocations, and boxing nodes. But then again, we also dump the graphs directly after EA since eliminate_macro_nodes()
is also called from there. Not sure if that's wanted. I guess it's okay being at IGV dump level 5. But we could also restrict the dumps to the post loop opts phase.
test/hotspot/jtreg/compiler/loopopts/TestPeelingSkeletonPredicateInitialization.java
Outdated
Show resolved
Hide resolved
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, modulo Christian's comments. Regarding whether to randomize macro node elimination, I find it a bit confusing that PhaseMacroExpand
also eliminates macro nodes, perhaps it would be better to, in a separate RFE, split the phase into PhaseMacroEliminate
and PhaseMacroExpand
, and introduce a separate StressMacroElimination
option and new phase names for the former?
Thanks @chhagedorn and @robcasloz. I made the trivial changes suggested by Christian, so the remaining question is how to handle dump levels and what/when to dump. My suggestion: set dump levels to 5 for now, as Christian suggests, but do not yet add any dumps to |
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.
Thanks for the updates!
Regarding whether to randomize macro node elimination, I find it a bit confusing that PhaseMacroExpand also eliminates macro nodes, perhaps it would be better to, in a separate RFE, split the phase into PhaseMacroEliminate and PhaseMacroExpand, and introduce a separate StressMacroElimination option and new phase names for the former?
I agree with that. A new phase would be better. Let's do that in a separate RFE.
My suggestion: set dump levels to 5 for now, as Christian suggests, but do not yet add any dumps to eliminate_macro_nodes. I'll create a separate RFE with Roberto's suggestion (which I think sounds good and, looking at the code, quite easy to achieve through a bit of restructuring) together with IGV dumping for macro elimination. What do you think?
Sounds good!
test/hotspot/jtreg/compiler/loopopts/TestPeelingSkeletonPredicateInitialization.java
Outdated
Show resolved
Hide resolved
@dlunde 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 145 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. As you do not have Committer status in this project an existing Committer must agree to sponsor your change. Possible candidates are the reviewers of this PR (@chhagedorn, @robcasloz, @TobiHartmann) but any other Committer may sponsor as well. ➡️ To flag this PR as ready for integration with the above commit message, type |
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!
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.
Nice! The changes look good to me.
Yes, I agree with this. |
I've now rerun tests and this is ready for integration. Thanks for the reviews, please sponsor! /integrate |
/sponsor |
Going to push as commit 4abb10e.
Your commit was automatically rebased without conflicts. |
@robcasloz @dlunde Pushed as commit 4abb10e. 💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored. |
This changeset adds a flag
StressMacroExpansion
which randomizes macro expansion ordering for stress testing purposes.Changes:
StressMacroExpansion
.StressMacroExpansion
, analogous to testing for previous stress flags such asStressIGVN
.StressMacroExpansion
to a number of tests that already turn on all other stress flags (and therefore should also useStressMacroExpansion
).MACRO_EXPANSION
toAFTER_MACRO_EXPANSION
.StressMacroExpansion
testing. Below is a sample phase list screenshot including the new phase (IGV print level 5 with "After Iter GVN Step" omitted).Question for the review: are the new macro expansion Ideal phases OK, or should we change anything?
Testing:
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/17684/head:pull/17684
$ git checkout pull/17684
Update a local copy of the PR:
$ git checkout pull/17684
$ git pull https://git.openjdk.org/jdk.git pull/17684/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 17684
View PR using the GUI difftool:
$ git pr show -t 17684
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/17684.diff
Webrev
Link to Webrev Comment