-
Couldn't load subscription status.
- Fork 6.1k
8315920: C2: "control input must dominate current control" assert failure #15720
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
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.
This looks good to me but needs some more comments.
| post_head->set_normal_loop(); | ||
| post_head->set_post_loop(main_head); | ||
|
|
||
| main_exit = outer_main_end->proj_out(false); |
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.
Please add a comment explaining that/why the main_exit projection changed.
| } | ||
|
|
||
| // If 'use' was in the loop-exit block, it now needs to be sunk | ||
| // below the post-loop merge 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.
This comment needs to be moved to the new lazy-replace logic and cloning needs to be explained there as well.
|
@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 96 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.
Looks good to me, too.
| } | ||
|
|
||
| assert(use->is_Proj(), "loop exit should be projections"); | ||
| Node* use_clone = use->clone(); |
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.
Maybe also add a comment here why you need to clone the node for lazy_replace().
Co-authored-by: Tobias Hartmann <tobias.hartmann@oracle.com>
Co-authored-by: Tobias Hartmann <tobias.hartmann@oracle.com>
Co-authored-by: Tobias Hartmann <tobias.hartmann@oracle.com>
Co-authored-by: Christian Hagedorn <christian.hagedorn@oracle.com>
|
@TobiHartmann @chhagedorn thanks for reviewing this. I pushed a new commit with comments. Let me know if that looks ok to you. |
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 good to me, thanks for adding the comments!
Co-authored-by: Tobias Hartmann <tobias.hartmann@oracle.com>
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 update, looks good!
|
@TobiHartmann @chhagedorn thanks for the reviews. |
|
/integrate |
|
Going to push as commit 4e1e579.
Your commit was automatically rebased without conflicts. |
The assert fires during range check eliminationin code that was added
recently. It catches a bug that's been going unnoticed. The
array[0]load of the test case ends up on the exit of the loop above it. After
pre/main/post loops are created for this loop (the inner loop is
optimized out), the load is at a region merging control from the just
created pre/main/post loops but its control (as returned by
PhaseIdealLoop::get_ctrl()) is not updated by pre/main/post loopscreation code so it's still the exit projection of one of the
loops. This causes the assert to fire (the load has bad control) when
RC runs next in the same loop opts pass.
The current logic for pre/main/post loops creation does update the
control of nodes on an exit projection but only if the node is
referenced from some other node in the loop body.
I think a similar bug with a node assigned control at the exit but not
pinned is likely to exist. So I doubt simply going over nodes pinned
at exits during pre/main/post and updating their control is good
enough. What I propose instead is to
lazy_replace()the projectionby the region so that, for all nodes that are assigned the exit as
control,
get_ctrl()will then return the region. It's not entirelystraightforward to implement because the
lazy_replace()mechanismassumes the control being replaced is dead which is not the case
here. That's why in the patch the exit projection is cloned so the
existing one is dead and can be used in
lazy_replace(). This alsomakes the calls to
sink_use()redundant.Progress
Issue
Reviewers
Reviewing
Using
gitCheckout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/15720/head:pull/15720$ git checkout pull/15720Update a local copy of the PR:
$ git checkout pull/15720$ git pull https://git.openjdk.org/jdk.git pull/15720/headUsing Skara CLI tools
Checkout this PR locally:
$ git pr checkout 15720View PR using the GUI difftool:
$ git pr show -t 15720Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/15720.diff
Webrev
Link to Webrev Comment