-
Notifications
You must be signed in to change notification settings - Fork 5.8k
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
8305189: C2 failed "assert(_outcnt==1) failed: not unique" #13901
Conversation
👋 Welcome back roland! A progress list of the required criteria for merging this PR into |
Webrevs
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That looks reasonable.
@@ -54,6 +55,37 @@ Node* Opaque3Node::Identity(PhaseGVN* phase) { | |||
return this; | |||
} | |||
|
|||
CountedLoopNode* OpaqueZeroTripGuardNode::guarded_loop() const { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could be guarded with ifdef ASSERT
since you are only using it for an assertion.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I made that change.
@@ -6145,6 +6175,11 @@ void PhaseIdealLoop::build_loop_late_post_work(Node *n, bool pinned) { | |||
IdealLoopTree *chosen_loop = get_loop(least); | |||
if( !chosen_loop->_child ) // Inner loop? | |||
chosen_loop->_body.push(n);// Collect inner loops | |||
|
|||
if (!_verify_only && n->Opcode() == Op_OpaqueZeroTripGuard) { | |||
_zero_trip_guard_opaque_nodes.push(n); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a good idea to collect them newly here for each loop opts pass.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure if you're expecting me to comment on this or not.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No action required. I was first trying to suggest to move it to Compile
to the other predicate opaque node lists but then I've thought that this solution here is cleaner. So it was more of a 👍 (I will refactor these predicate lists in the assertion predicate changes - otherwise, I would have suggested to move them here as well at some point).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the clarification.
@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:
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 94 new commits pushed to the
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Update looks good!
Thanks for reviewing this @chhagedorn |
I see the following failure with
|
What happens here is that a counted loop ends up in an infinite loop. So the |
Would it still be required/useful to keep an |
You're right that it's probably safer to be conservative and rather than remove the opaque node anyway, keep it if we can't tell if it's useful or not. I updated the change with a new commit that does that. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree that it is better to be safe here - update looks good!
I'll resubmit some testing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree that it is better to be safe here - update looks good!
I'll resubmit some testing.
Co-authored-by: Christian Hagedorn <christian.hagedorn@oracle.com>
All testing passed! |
Thanks for the review and testing! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks reasonable to me.
@TobiHartmann thanks for the review |
/integrate |
Going to push as commit bac02b6.
Your commit was automatically rebased without conflicts. |
pre/main/post loops are created for an inner loop of a loop nest but
assert predicates cause the main and post loops to be removed. The
OpaqueZeroTripGuard nodes for the loops are not removed: there's no
logic to trigger removal of the opaque nodes once the loops are no
longer there. With the inner loops gone, the outer loop becomes
candidate for optimizations and is unrolled which causes the zero trip
guards of the now removed loops to be duplicated and the opaque nodes
to have more than one use.
The fix I propose is, using logic similar to
PhaseIdealLoop::eliminate_useless_predicates()
, to check during loopopts if every OpaqueZeroTripGuard node guards a loop and if not,
remove it.
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/13901/head:pull/13901
$ git checkout pull/13901
Update a local copy of the PR:
$ git checkout pull/13901
$ git pull https://git.openjdk.org/jdk.git pull/13901/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 13901
View PR using the GUI difftool:
$ git pr show -t 13901
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/13901.diff
Webrev
Link to Webrev Comment