-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
8266480: Implicit null check optimization does not update control of hoisted memory operation #4093
Conversation
…hoisted memory operation
👋 Welcome back thartmann! A progress list of the required criteria for merging this PR into |
@TobiHartmann 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. |
Does nodes 73, 77 and 78 touch different memory slices? Otherwise 78 should be anti-dependent on 73 and 77. |
Yes, exactly. They are accessing 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!
@TobiHartmann 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 8 new commits pushed to the
Please see this link for an up-to-date comparison between the source branch of this pull request and the ➡️ To integrate this PR with the above commit message to the |
Thanks, Nils! |
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.
Thanks, Vladimir! |
/integrate |
@TobiHartmann Since your change was applied there have been 15 commits pushed to the
Your commit was automatically rebased without conflicts. Pushed as commit c2b50f9. 💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored. |
C2 replaces explicit null checks by hoisting a nearby memory operation to the null check and using it as implicit null check. In some cases, control of that memory operation is not updated correctly, leading to assert failures during
PhaseCFG::verify()
because a use is no longer dominated by its definition.After matching, the graph looks like this:
64 testP_reg
is an explicit null check and78 loadD
,73 storeD
and77 storeImmI
are candidates for an implicit null check because they are operating on the same oop.PhaseCFG::implicit_null_check
decides to hoist the77 storeImmI
from thenot_null_block
B12 to the null check in B11/B13:Now the problem is that control of
77 storeImmI
was not updated and still points into the non-dominating block B15. The following code is supposed to fix this:jdk/src/hotspot/share/opto/lcm.cpp
Lines 413 to 418 in 9d168e2
However, it does not trigger because control is not the
not_null_block->head()
but59 MachProj
which is the control projection from60 CallLeafDirect
emitted by adrem
. The fix is to simply checkget_block_for_node(ctrl)
instead.This is an old issue that was only caught by the assert recently introduced by JDK-8263227.
Thanks,
Tobias
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.java.net/jdk pull/4093/head:pull/4093
$ git checkout pull/4093
Update a local copy of the PR:
$ git checkout pull/4093
$ git pull https://git.openjdk.java.net/jdk pull/4093/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 4093
View PR using the GUI difftool:
$ git pr show -t 4093
Using diff file
Download this PR as a diff file:
https://git.openjdk.java.net/jdk/pull/4093.diff