-
Notifications
You must be signed in to change notification settings - Fork 6.2k
8374622: StressIncrementalInlining should also randomize the processing order #29110
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
base: master
Are you sure you want to change the base?
Conversation
|
👋 Welcome back mchevalier! A progress list of the required criteria for merging this PR into |
|
@marc-chevalier 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 16 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 |
|
@marc-chevalier 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. |
TobiHartmann
left a comment
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. Please make sure that this doesn't immediately trigger bugs in our testing 🙂
|
Right, I didn't write there, but I've tested with tier 1-3 and internal tests. All good. I'll test with more flags, tho. |
|
Sounds good, thanks! |
| uint low_live_nodes = 0; | ||
|
|
||
| if (StressIncrementalInlining) { | ||
| shuffle_late_inlines(); |
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.
It shuffles initial list, but doesn't have any effects on elements added during incremental inlining. Do we want to shuffle them as well?
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.
Good point. I don't see why we wouldn't want 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.
Actually, I'm not sure. I see that
jdk/src/hotspot/share/opto/compile.hpp
Line 480 in 8737a8c
| int _late_inlines_pos; // Where in the queue should the next late inlining candidate go (emulate depth first inlining) |
and
jdk/src/hotspot/share/opto/compile.hpp
Lines 1059 to 1062 in 8737a8c
| void add_late_inline(CallGenerator* cg) { | |
| _late_inlines.insert_before(_late_inlines_pos, cg); | |
| _late_inlines_pos++; | |
| } |
But reading the code, I don't understand why it's important to insert just at this position, and not simply at this position or after (and then, why not at the end, to avoid shifting?). In
inline_incrementally_onejdk/src/hotspot/share/opto/compile.cpp
Lines 2123 to 2126 in 8737a8c
| } else if (inlining_progress()) { | |
| _late_inlines_pos = i+1; // restore the position in case new elements were inserted | |
| print_method(PHASE_INCREMENTAL_INLINE_STEP, 3, cg->call_node()); | |
| break; // process one call site at a time |
We seem to stop as soon as something happens, so we wouldn't really use the fact that the coming elements in
_late_inlines are related. Overall, I don't see where this assumption of depth-first is used.
A little bit of testing doesn't catch fire when inserting potentially after _late_inlines_pos. I'll read and test more, but maybe someone already has more context? Maybe @iwanowww or @rwestrel from looking at git blame?
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.
During late inlining we want to preserve relative order or candidate sites for late inlining. It matters when compiler runs out of inlining budget. If it appends candidates instead, it turns DFS call site traversal into BFS.
As it says: randomize the order the late inlines are processed, and slightly factor it with macro nodes.
I didn't add shuffle to the
GrowableArrayclass since it seems a bit method specialized method (and it seems it'd be a controversial change to a widely use class), it would makeGrowableArraydepends onCompilefor random number generation (or require a callback, for instance, giving a non-trivial signature and usage), I couldn't find other shuffling of such an object.There is also shuffling of
UniqueNodeList(forStressIGVN), but it seems hard to unify: access and length are not written quite the same, it would probably be not simpler than duplicating the implem (which is simple, so it's fine in my opinion).Thanks,
Marc
Progress
Issue
Reviewers
Reviewing
Using
gitCheckout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/29110/head:pull/29110$ git checkout pull/29110Update a local copy of the PR:
$ git checkout pull/29110$ git pull https://git.openjdk.org/jdk.git pull/29110/headUsing Skara CLI tools
Checkout this PR locally:
$ git pr checkout 29110View PR using the GUI difftool:
$ git pr show -t 29110Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/29110.diff
Using Webrev
Link to Webrev Comment