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
8282045: When loop strip mining fails, safepoints are removed from loop anyway #7513
Conversation
|
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.
Noticed a typo in PhaseIdealLoop::find_safepoint
that you might want to fix as well with this patch:
there's not side effect
-> there's no side effect
src/hotspot/share/opto/loopnode.cpp
Outdated
@@ -1859,6 +1849,38 @@ bool PhaseIdealLoop::is_counted_loop(Node* x, IdealLoopTree*&loop, BasicType iv_ | |||
} | |||
} | |||
|
|||
Node *sfpt2 = NULL; |
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.
Node *sfpt2 = NULL; | |
Node* sfpt2 = NULL; |
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 would suggest to rename sfpt2
to sfpt
and sfpt
below to backedge_sfpt
.
src/hotspot/share/opto/loopnode.cpp
Outdated
} | ||
|
||
if (x->in(LoopNode::LoopBackControl)->Opcode() == Op_SafePoint) { | ||
Node *sfpt = x->in(LoopNode::LoopBackControl); |
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.
Node *sfpt = x->in(LoopNode::LoopBackControl); | |
Node* sfpt = x->in(LoopNode::LoopBackControl); |
src/hotspot/share/opto/loopnode.cpp
Outdated
// location. Give up on that loop. | ||
return false; | ||
} | ||
if (deleteable) { |
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.
Can't you check is_deleteable_safept
inline here like old code did?
@TobiHartmann thanks for looking at this. The new commit should take care of your comments. |
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, looks good to me.
Also, I executed some testing and it all passed. |
@rwestrel This change now passes all automated pre-integration checks. 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 22 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.
|
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!
@TobiHartmann @chhagedorn thanks for the reviews. |
/integrate |
Going to push as commit 2c5d266.
Your commit was automatically rebased without conflicts. |
I noticed that if loop strip mining fails because a safepoint is not
found right above the exit test (following partial peel for instance),
all safepoints are removed from the loop anyway. That's fixed by the
change in IdealLoopTree::counted_loop() where rather than test if loop
strip mining is enabled, the check now verifies that loop strip mining
was successful.
With that change,
compiler/c2/irTests/TestAutoVectorization2DArray.java fails. The loop
is not converted into a strip mined loop because there's no safepoint
above the exit test after partial peeling. The loop strip mining logic
is too strict when it comes to the safepoint location. Any safepoint
that dominates the exit and is in the loop as long as there's no side
effect between the safepoint and the exit can be used. The patch
implements that change as well. TestAutoVectorization2DArray.java
passes as a result.
The existing requirement to have no safepoint on the backedge is too
strict as well. If the loop has another safepoint that can be used for
strip mining, then the safepoint on the backedge can safely be
dropped. That's also implemented by the patch.
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.java.net/jdk pull/7513/head:pull/7513
$ git checkout pull/7513
Update a local copy of the PR:
$ git checkout pull/7513
$ git pull https://git.openjdk.java.net/jdk pull/7513/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 7513
View PR using the GUI difftool:
$ git pr show -t 7513
Using diff file
Download this PR as a diff file:
https://git.openjdk.java.net/jdk/pull/7513.diff