Skip to content
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

Closed
wants to merge 1 commit into from

Conversation

GoeLin
Copy link
Member

@GoeLin GoeLin commented Jul 6, 2023

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

  • Change must be properly reviewed (1 review required, with at least 1 Reviewer)
  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue

Issue

  • JDK-8307683: Loop Predication should not hoist range checks with trap on success projection by negating their condition (Bug - P3)

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

@bridgekeeper
Copy link

bridgekeeper bot commented Jul 6, 2023

👋 Welcome back goetz! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk openjdk bot changed the title Backport dfd3da3f52480f68f653beb1e720691f8232ace7 8307683: Loop Predication should not hoist range checks with trap on success projection by negating their condition Jul 6, 2023
@openjdk
Copy link

openjdk bot commented Jul 6, 2023

This backport pull request has now been updated with issue from the original commit.

@openjdk openjdk bot added backport rfr Pull request is ready for review labels Jul 6, 2023
@mlbridge
Copy link

mlbridge bot commented Jul 6, 2023

Webrevs

@jerboaa
Copy link
Contributor

jerboaa commented Jul 6, 2023

@rwestrel Could you please help review this? Thanks!

Copy link
Contributor

@rwestrel rwestrel left a 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.

@openjdk
Copy link

openjdk bot commented Jul 11, 2023

@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:

8307683: Loop Predication should not hoist range checks with trap on success projection by negating their condition

Reviewed-by: roland

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 master branch:

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 master branch, type /integrate in a new comment.

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Jul 11, 2023
@GoeLin
Copy link
Member Author

GoeLin commented Jul 12, 2023

@jerboa, do you want to verify this and the redo with your contacts that spotted the underlying issue?

@jerboaa
Copy link
Contributor

jerboaa commented Jul 13, 2023

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.

@GoeLin
Copy link
Member Author

GoeLin commented Jul 13, 2023

In case you make a build with this and the redo change, you will need to do a simple build fix renaming a variable.

@jerboaa
Copy link
Contributor

jerboaa commented Jul 13, 2023

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.

@jerboaa
Copy link
Contributor

jerboaa commented Jul 13, 2023

@GoeLin Testing looks good on my end. Thanks!

@GoeLin
Copy link
Member Author

GoeLin commented Jul 14, 2023

/integrate

Thanks for review and testing!

@openjdk
Copy link

openjdk bot commented Jul 14, 2023

Going to push as commit 3cc7858.
Since your change was applied there have been 34 commits pushed to the master branch:

  • 9f3c095: 8307555: Reduce memory reads in x86 MD5 intrinsic
  • 2b8c260: 8310259: Pin msys2/setup-msys2 github action to a specific commit
  • 3006096: 8308192: Error in parsing replay file when staticfield is an array of single dimension
  • b0b79a9: 8301097: Update GHA XCode to 12.5.1
  • 310115a: 8305763: Parsing a URI with an underscore goes through a silent exception, negatively impacting performance
  • e61bb2e: 8267517: async logging for stdout and stderr
  • 9288072: 8292716: Configure should check that jtreg is of the required version
  • 1248b15: 8303154: Investigate and improve instruction cache flushing during compilation
  • 4eeb1c9: 8180266: Convert sun/security/provider/KeyStore/DKSTest.sh to Java Jtreg Test
  • f45578e: 8225012: sanity/client/SwingSet/src/ToolTipDemoTest.java fails on Windows
  • ... and 24 more: https://git.openjdk.org/jdk17u-dev/compare/688a823747d38502505050bf395c5328b291d46c...master

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot added the integrated Pull request has been integrated label Jul 14, 2023
@openjdk openjdk bot closed this Jul 14, 2023
@openjdk openjdk bot removed ready Pull request is ready to be integrated rfr Pull request is ready for review labels Jul 14, 2023
@openjdk
Copy link

openjdk bot commented Jul 14, 2023

@GoeLin Pushed as commit 3cc7858.

💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport integrated Pull request has been integrated
3 participants