-
Notifications
You must be signed in to change notification settings - Fork 6.1k
8296545: C2 Blackholes should allow load optimizations #11041
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
Conversation
👋 Welcome back shade! A progress list of the required criteria for merging this PR into |
Webrevs
|
Ooh, nice work. Unfortunately the VerifyGraphEdges test seems to be failing. |
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.
It is just copy of insert_mem_bar()
without setting memory to BH.
@shipilev 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 no new commits pushed to the ➡️ To integrate this PR with the above commit message to the |
|
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 for me with one 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.
(hs-tier1 - hs-tier2 testing passed.)
Thanks for reviews. I'll sit on it a bit, while doing more extensive benchmarking with these new blackholes. |
Experiments look fine. I am integrating to get this to JDK 20. /integrate |
Going to push as commit eab0ada.
Your commit was automatically rebased without conflicts. |
If you look at generated code for the JMH benchmark like:
...then you would notice that the loop always re-reads
is
,is.length
, does the range check, etc. -- all the things we would otherwise expect to be hoisted out of the loop.This is because C2 blackholes are modeled as membars that pinch both control and memory slices (like you would expect from the opaque non-inlined call), therefore every iteration has to re-read the referenced memory contents and recompute everything dependent on those loads. This behavior is not new -- the old, non-compiler blackholes were doing the same thing, accidentally -- but it was drowned in blackhole overheads. Now, these effects are clearly visible.
We can try to do this a bit better: allow load optimizations to work across the blackholes, leaving only "prevent dead code elimination" part, as minimally required by blackhole semantics.
Motivational improvements on the test above:
-prof perfasm
shows the reason for these improvements clearly:Before:
After:
Additional testing:
-prof perfasm
compiler/blackhole
,compiler/c2/irTests/blackhole
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk pull/11041/head:pull/11041
$ git checkout pull/11041
Update a local copy of the PR:
$ git checkout pull/11041
$ git pull https://git.openjdk.org/jdk pull/11041/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 11041
View PR using the GUI difftool:
$ git pr show -t 11041
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/11041.diff