8367244: [lworld] C2 compilation fails with assert "no node with a side effect" #1716
+83
−8
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem Analysis
The stress test
compiler/valhalla/inlinetypes/TestAcmpWithUnstableIf.java, which uses theStressUnstableIfTrapflag, failed intermittently with the assert "no node with a side effect" during C2 compilation. I tracked down the origin of the failure to the raw store of the unstable if trap stress counter that was missing a memory edge to the backedge phi and thus had no side effect in the loop, which lead to the aforementioned assert. During parsing, the missing memory edge gets discarded with as vestigial parsing state whendo_if()ends upstopped(). However, the effect of the stress counter should still be wired back into the backedge since it will be incremented in the next iteration.Patch Description
To prevent the stress counters memory state being lost to
PreserveJVMState, I pass it to the caller over an out-parameter andset_memorywith that node, similar to what is already done for control. This is only necessary for the two last invocation ofdo_if()indo_acmp()where they are actually allowed to trap. Further, this PR reenablesStressUnstableIfTrapincompiler/valhalla/inlinetypes/TestAcmpWithUnstableIf.java.Testing
Progress
Issue
Reviewing
Using
gitCheckout this PR locally:
$ git fetch https://git.openjdk.org/valhalla.git pull/1716/head:pull/1716$ git checkout pull/1716Update a local copy of the PR:
$ git checkout pull/1716$ git pull https://git.openjdk.org/valhalla.git pull/1716/headUsing Skara CLI tools
Checkout this PR locally:
$ git pr checkout 1716View PR using the GUI difftool:
$ git pr show -t 1716Using diff file
Download this PR as a diff file:
https://git.openjdk.org/valhalla/pull/1716.diff
Using Webrev
Link to Webrev Comment