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

8279886: C1: Turn off SelectivePhiFunctions in presence of irreducible loops #7636

Closed
wants to merge 2 commits into from

Conversation

veresov
Copy link
Contributor

@veresov veresov commented Feb 28, 2022

This change add irreducible loops detection to BlockListBuilder::mark_loops() - a loop marking routine necessary for the SSA conversion. Here is brief description of the algorithm (copy-pasted from the comments I left in the code).

The loop detection algorithm works as follows:

  • We maintain the _loop_map, where for each block we have a bitmap indicating which loops contain this block.
  • The CFG is recursively traversed (depth-first) and if we detect a loop, we assign the loop a unique number that is stored in the bitmap associated with the loop header block. Until we return back through that loop header the bitmap contains only a single bit corresponding to the loop number.
  • The bit is then propagated for all the blocks in the loop after we exit them (post-order). There could be multiple bits of course in case of nested loops.
  • When we exit the loop header we remove that single bit and assign the real loop state for it.
  • Now, the tricky part here is how we detect irriducible loops. In the algorithm above the loop state bits are propagated to the predecessors. If we encounter an irreducible loop (a loop with multiple heads) we would see a node with some loop bit set that would then propagate back and be never cleared because we would never go back through the original loop header. Therefore if there are any irreducible loops the bits in the states for these loops are going to propagate back to the root.

Testing is clean: hs-tier{1-7}


Progress

  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • Change must be properly reviewed

Issue

  • JDK-8279886: C1: Turn off SelectivePhiFunctions in presence of irreducible loops

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.java.net/jdk pull/7636/head:pull/7636
$ git checkout pull/7636

Update a local copy of the PR:
$ git checkout pull/7636
$ git pull https://git.openjdk.java.net/jdk pull/7636/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 7636

View PR using the GUI difftool:
$ git pr show -t 7636

Using diff file

Download this PR as a diff file:
https://git.openjdk.java.net/jdk/pull/7636.diff

@bridgekeeper
Copy link

bridgekeeper bot commented Feb 28, 2022

👋 Welcome back iveresov! 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 added the rfr Pull request is ready for review label Feb 28, 2022
@openjdk
Copy link

openjdk bot commented Feb 28, 2022

@veresov The following label will be automatically applied to this pull request:

  • hotspot-compiler

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.

@openjdk openjdk bot added the hotspot-compiler hotspot-compiler-dev@openjdk.org label Feb 28, 2022
@mlbridge
Copy link

mlbridge bot commented Feb 28, 2022

Webrevs

@veresov veresov force-pushed the c1-ssa-convertion branch from 803a83e to 8daaf31 Compare March 1, 2022 15:46
Copy link
Contributor

@vnkozlov vnkozlov 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.

@openjdk
Copy link

openjdk bot commented Mar 1, 2022

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

8279886: C1: Turn off SelectivePhiFunctions in presence of irreducible loops

Reviewed-by: kvn, dlong

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 31 new commits pushed to the master branch:

  • fb6b929: 8277474: jarsigner does not check if algorithm parameters are disabled
  • 1581e3f: 8282402: Create a regression test for JDK-4666101
  • 268fa69: 8282511: Use fixed certificate validation date in SSLExampleCert template
  • c777bb3: 8282619: G1: Fix indentation in G1CollectedHeap::mark_evac_failure_object
  • 080baff: 8282483: Ensure that Utils.getAllInterfaces returns unique instances
  • 57020fd: 8282582: Unused methods in Utils
  • 5c187e3: 8282593: JDK-8281472 breaks 32-bit builds and gtests
  • 7822cbc: 8276711: compiler/codecache/cli tests failing when SegmentedCodeCache used with -Xint
  • 832729b: 6911375: mouseWheel has no effect without vertical scrollbar
  • 0402a28: 8037965: NullPointerException in TextLayout.getBaselineFromGraphic() for JTextComponents
  • ... and 21 more: https://git.openjdk.java.net/jdk/compare/76398c84007862bdf07cea6be792eca50eec9edd...master

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 Mar 1, 2022
Copy link
Member

@dean-long dean-long left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice!

@veresov
Copy link
Contributor Author

veresov commented Mar 4, 2022

Thanks @vnkozlov and @dean-long for the reviews!
/integrate

@openjdk
Copy link

openjdk bot commented Mar 4, 2022

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

  • 7e1c67d: 8282608: RawNativeLibraryImpl can't be passed to NativeLibraries::findEntry0
  • 8478173: 8282583: Update BCEL md to include the copyright notice
  • fb6b929: 8277474: jarsigner does not check if algorithm parameters are disabled
  • 1581e3f: 8282402: Create a regression test for JDK-4666101
  • 268fa69: 8282511: Use fixed certificate validation date in SSLExampleCert template
  • c777bb3: 8282619: G1: Fix indentation in G1CollectedHeap::mark_evac_failure_object
  • 080baff: 8282483: Ensure that Utils.getAllInterfaces returns unique instances
  • 57020fd: 8282582: Unused methods in Utils
  • 5c187e3: 8282593: JDK-8281472 breaks 32-bit builds and gtests
  • 7822cbc: 8276711: compiler/codecache/cli tests failing when SegmentedCodeCache used with -Xint
  • ... and 23 more: https://git.openjdk.java.net/jdk/compare/76398c84007862bdf07cea6be792eca50eec9edd...master

Your commit was automatically rebased without conflicts.

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

openjdk bot commented Mar 4, 2022

@veresov Pushed as commit b629782.

💡 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
hotspot-compiler hotspot-compiler-dev@openjdk.org integrated Pull request has been integrated
Development

Successfully merging this pull request may close these issues.

3 participants