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

8263376: CTW (Shenandoah): assert(mems <= 1) failed: No node right after call if multiple mem projections #3006

Closed
wants to merge 2 commits into from

Conversation

rwestrel
Copy link
Contributor

@rwestrel rwestrel commented Mar 15, 2021

This is another case of anti-dependence analysis being too conservative.

In TestBadRawMemoryAfterCall.test2(), test

if (i == 42) {

is split thru the Phi that merges values from the fallthru and
exception paths. As a consequence, control flow at the call is
roughly:

a.m() call
|         \       
fallthru  exception
|             |
if (i == 42)  |
|      \      |
|       Region1
\        /
  Region2

When anti-dependence analysis runs for the load after the call, it
starts from the memory state out of the call on the fallthru path. One
use is a memory Phi at Region2 (say Phi2). Another path leads to
Region1 at, say, Phi1.

When anti-dependence analysis then goes over Phis, it processes Phi2,
goes over the its inputs and finds that 2 are reachable: the one that
has a direct edge to the memory state on the fallthru path and the one
from Phi1. As a consequence, control for the load is set to be right
after the call, which is too conservative.

When following the memory edges, the code stops at Phi1. It doesn't
process uses of Phi1. Any anti-dependence that's needed between the
load and Phi1 is then taken into account when Phis are processed. When
inputs to Phi2 are processed, considering the Phi2->Phi1 is too
conservative. As mentioned above, anti-dependences for Phi1 are taken
into account separately. I think it's true for all Phi->Phi edges that
they can be safely ignored. That's what I propose as a fix.

/cc shenandoah,hotspot-compiler


Progress

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

Issue

  • JDK-8263376: CTW (Shenandoah): assert(mems <= 1) failed: No node right after call if multiple mem projections

Reviewers

Download

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

To update a local copy of the PR:
$ git checkout pull/3006
$ git pull https://git.openjdk.java.net/jdk pull/3006/head

@bridgekeeper
Copy link

@bridgekeeper bridgekeeper bot commented Mar 15, 2021

👋 Welcome back roland! 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 rfr shenandoah hotspot-compiler labels Mar 15, 2021
@openjdk
Copy link

@openjdk openjdk bot commented Mar 15, 2021

@rwestrel
The shenandoah label was successfully added.

The hotspot-compiler label was successfully added.

@mlbridge
Copy link

@mlbridge mlbridge bot commented Mar 15, 2021

Webrevs

@rwestrel
Copy link
Contributor Author

@rwestrel rwestrel commented Mar 25, 2021

Anyone for a review of this relatively simple change? Change is in shared code.

Copy link
Contributor

@vnkozlov vnkozlov left a comment

Okay.

@openjdk
Copy link

@openjdk openjdk bot commented Mar 25, 2021

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

8263376: CTW (Shenandoah): assert(mems <= 1) failed: No node right after call if multiple mem projections

Reviewed-by: kvn, chagedorn

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

  • 4e74de4: 8264111: (fs) Leaking NativeBuffers in case of errors during UnixUserDefinedFileAttributeView.read/write
  • 57115fa: 8189198: Add "forRemoval = true" to Applet API deprecations
  • b8122d6: 8264220: jdk/javadoc/doclet/testRelatedPackages/TestRelatedPackages.java fails to compile
  • 507b690: 8264126: Remove TRAPS/THREAD parameter for class loading functions
  • f3eed05: 8263928: Add JAWT test files for mac
  • 4fbb7c2: 8263472: Specification of JComponent::updateUI should document that the default implementation does nothing
  • e47dfb8: 8264062: Use the blessed modifier order in jdk.jfr
  • 5a930c4: 8264135: UnsafeGetStableArrayElement should account for different JIT implementation details
  • bb354b9: 8264166: OopStorage should support specifying MEMFLAGS for allocations
  • 41657b1: 8261551: Remove special CDS handling in Metaspace::allocate
  • ... and 236 more: https://git.openjdk.java.net/jdk/compare/a9b156d358b0436584a33f71abc00c9bed9d47a3...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 label Mar 25, 2021
Copy link
Member

@chhagedorn chhagedorn left a comment

You should also add the bug number to the test.

Otherwise, looks good to me.

@rwestrel
Copy link
Contributor Author

@rwestrel rwestrel commented Mar 26, 2021

You should also add the bug number to the test.

done.

Otherwise, looks good to me.

Thanks for the review.

@rwestrel
Copy link
Contributor Author

@rwestrel rwestrel commented Mar 26, 2021

Okay.

thanks for the review

@rwestrel
Copy link
Contributor Author

@rwestrel rwestrel commented Mar 26, 2021

/integrate

@openjdk openjdk bot closed this Mar 26, 2021
@openjdk openjdk bot added integrated and removed ready rfr labels Mar 26, 2021
@openjdk
Copy link

@openjdk openjdk bot commented Mar 26, 2021

@rwestrel Since your change was applied there have been 246 commits pushed to the master branch:

  • 4e74de4: 8264111: (fs) Leaking NativeBuffers in case of errors during UnixUserDefinedFileAttributeView.read/write
  • 57115fa: 8189198: Add "forRemoval = true" to Applet API deprecations
  • b8122d6: 8264220: jdk/javadoc/doclet/testRelatedPackages/TestRelatedPackages.java fails to compile
  • 507b690: 8264126: Remove TRAPS/THREAD parameter for class loading functions
  • f3eed05: 8263928: Add JAWT test files for mac
  • 4fbb7c2: 8263472: Specification of JComponent::updateUI should document that the default implementation does nothing
  • e47dfb8: 8264062: Use the blessed modifier order in jdk.jfr
  • 5a930c4: 8264135: UnsafeGetStableArrayElement should account for different JIT implementation details
  • bb354b9: 8264166: OopStorage should support specifying MEMFLAGS for allocations
  • 41657b1: 8261551: Remove special CDS handling in Metaspace::allocate
  • ... and 236 more: https://git.openjdk.java.net/jdk/compare/a9b156d358b0436584a33f71abc00c9bed9d47a3...master

Your commit was automatically rebased without conflicts.

Pushed as commit 33c94ff.

💡 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 integrated shenandoah
3 participants