-
Notifications
You must be signed in to change notification settings - Fork 213
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
8307683: Loop Predication should not hoist range checks with trap on success projection by negating their condition #1553
Conversation
👋 Welcome back goetz! A progress list of the required criteria for merging this PR into |
This backport pull request has now been updated with issue from the original commit. |
@rwestrel Could you please help review this? Thanks! |
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.
@GoeLin 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 21 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 |
@jerboa, do you want to verify this and the redo with your contacts that spotted the underlying issue? |
Good idea! Let me run some tests and I'll report back. Thanks. |
In case you make a build with this and the redo change, you will need to do a simple build fix renaming a variable. |
OK. |
@GoeLin Testing looks good on my end. Thanks! |
/integrate Thanks for review and testing! |
Going to push as commit 3cc7858.
Your commit was automatically rebased without conflicts. |
This fixes a regression in 17.0.7. To work around the regression, JDK-8297951 was backed out in 17.0.8.
Big parts of this change is passing a Proj node instead of the If that is the predecessor of the Proj through method calls. As methods differ in their arguments in 17, all these had to be resolved.
The real fix is in loop_predication_impl_helper().
Resolves in detail:
src/hotspot/share/opto/loopPredicate.cpp
In head, there are two variants of is_range_check_if(), 17 has only one. Omitted the changes to the second one.
loop_predication_impl_helper()
Renamed the variable. In head, it is if_proj->if_success_proj, here it is proj->success_proj.
I introduce a new vairalbe IfProjNode if_success_proj. Calls to loop_predication_impl_helper
pass Projs and not IfProjs, so this seems cleaner. Added assertion.
Passing proj instead of if to is_range_check_if().
Computation of the deleted "bool negate" differs. Deleted anyways.
Removed all the uses of negate.
src/hotspot/share/opto/loopTransform.cpp
Trivial resolve.
src/hotspot/share/opto/loopnode.cpp
extract_long_range_checks() was introduced in "8259609: C2: optimize long range checks in long counted loops".
The change is only needed as the input to is_range_check_if() was
changed from the IfNode to the IfProjNode below. The change here has no effect on the fix. Skipped.
patching file src/hotspot/share/opto/loopnode.hpp
Resolved, simple differences.
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk17u-dev.git pull/1553/head:pull/1553
$ git checkout pull/1553
Update a local copy of the PR:
$ git checkout pull/1553
$ git pull https://git.openjdk.org/jdk17u-dev.git pull/1553/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 1553
View PR using the GUI difftool:
$ git pr show -t 1553
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk17u-dev/pull/1553.diff
Webrev
Link to Webrev Comment