Skip to content
This repository has been archived by the owner on Sep 2, 2022. It is now read-only.

8260709: C2: assert(false) failed: unscheduable graph #144

Closed
wants to merge 1 commit into from

Conversation

rwestrel
Copy link
Contributor

@rwestrel rwestrel commented Feb 2, 2021

The v = field load in the test case is found anti-dependent with the
memory phi that merges the exception state of the 2 array
allocation. Since JDK-8258393, anti-dependence computation only
considers the Phi inputs that are reachable from the memory input of a
load. As a consequence, the late control for the load is the control
projection of the array allocation in the loop. When loop opts run,
PhaseIdealLoop::split_if_with_blocks_post() finds that the load's late
control is different from its current control (which is inside the
outer loop). It tries to sink the load out of loop but ends up pinning
it at its late control, the projection of the second AllocateNode.

The logic that expands the AllocateNode doesn't expect a pinned node
on the control projection and the result is a broken graph. I think
the fix for this would be to clone the load along both the exception
and the fallthrough paths. But as noted in JDK-8252372, the whole
process of sinking loads out of loops doesn't seem to work as expected
(for instance in this case it sinks the load from the outer loop into
the inner loop). So instead of going with a complicated fix, I propose
simply to detect this corner and that no attempt be made to sink the
load. Note that the current logic computes the late control for the
load (which should be in the loop), will create a clone for each use
and assign the dom_lca of the use's control and the load late control
to that use, that is the load late control. So all uses end up at the
same location, the load late control. So to detect that case, it's
sufficient to test the load late control.


Progress

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

Issue

  • JDK-8260709: C2: assert(false) failed: unscheduable graph

Reviewers

Download

$ git fetch https://git.openjdk.java.net/jdk16 pull/144/head:pull/144
$ git checkout pull/144

Signed-off-by: rwestrel <rwestrel@redhat.com>
@bridgekeeper
Copy link

bridgekeeper bot commented Feb 2, 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 the rfr Pull request is ready for review label Feb 2, 2021
@openjdk
Copy link

openjdk bot commented Feb 2, 2021

@rwestrel 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.java.net label Feb 2, 2021
@mlbridge
Copy link

mlbridge bot commented Feb 2, 2021

Webrevs

Copy link
Member

@TobiHartmann TobiHartmann left a comment

Choose a reason for hiding this comment

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

This looks reasonable to me as a point fix for JDK 16, given the plan is to rework that code for JDK 17 with JDK-8252372.

@openjdk
Copy link

openjdk bot commented Feb 3, 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:

8260709: C2: assert(false) failed: unscheduable graph

Reviewed-by: thartmann, 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 4 new commits pushed to the master branch:

  • 1a7040e: 8259794: Remove EA from JDK 16 version string starting with Initial RC promotion on Feb 04, 2021(B35)
  • afd5eef: 8260704: ParallelGC: oldgen expansion needs release-store for _end
  • 081fa3e: 8260927: StringBuilder::insert is incorrect without Compact Strings
  • ed1a775: 8258378: Final nroff manpage update for JDK 16

Please see this link for an up-to-date comparison between the source branch of this pull request and 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 Feb 3, 2021
Copy link
Member

@chhagedorn chhagedorn left a comment

Choose a reason for hiding this comment

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

That sounds reasonable and looks good to me.

@rwestrel
Copy link
Contributor Author

rwestrel commented Feb 3, 2021

thanks for the reviews @TobiHartmann @chhagedorn

@rwestrel
Copy link
Contributor Author

rwestrel commented Feb 4, 2021

/integrate

@openjdk openjdk bot closed this Feb 4, 2021
@openjdk openjdk bot added integrated Pull request has been integrated and removed ready Pull request is ready to be integrated rfr Pull request is ready for review labels Feb 4, 2021
@openjdk
Copy link

openjdk bot commented Feb 4, 2021

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

  • 5307afa: 8260585: AArch64: Wrong code generated for shifting right and accumulating four unsigned short integers
  • 1a7040e: 8259794: Remove EA from JDK 16 version string starting with Initial RC promotion on Feb 04, 2021(B35)
  • afd5eef: 8260704: ParallelGC: oldgen expansion needs release-store for _end
  • 081fa3e: 8260927: StringBuilder::insert is incorrect without Compact Strings
  • ed1a775: 8258378: Final nroff manpage update for JDK 16

Your commit was automatically rebased without conflicts.

Pushed as commit 4de3a6b.

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
hotspot-compiler hotspot-compiler-dev@openjdk.java.net integrated Pull request has been integrated
3 participants