-
Notifications
You must be signed in to change notification settings - Fork 6.1k
8265938: C2's conditional move optimization does not handle top Phi #3684
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 thartmann! A progress list of the required criteria for merging this PR into |
@TobiHartmann The following label will be automatically applied to this pull request:
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. |
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.
Looks reasonable to me!
@TobiHartmann 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 44 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 |
Thanks for the review, Christian! |
@TobiHartmann Thanks for fixing tencent reported bug! Your fix is good. Could an early check added after ccp GVN? Check if it is compiling a method currently in inifinite loop and abort compilation earlier?
|
@huishi-hs thanks for the review. This version of the fix was also proposed by the reporter but is not sufficient because it assumes that the infinite loop is reachable from all exit paths. This is not the case in my version of the regression test, were the infinite loop is only in the |
You're right. Test is modified. Thanks! |
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.
The fix is good.
I think you need System.exit(0) (or something else) at the end of test. Otherwise the test runs forever due to presence of infinite loop in an other thread. I tried.
May be @iignatev can suggest graceful solution for timely exit in such case.
one way to solve it is to make the thread created at L#57 daemon thread (+L64: I'd also recommend you to use |
@TobiHartmann I ran test locally (not with jtreg). TestStrangeControl.java has the same issue when run standalone. |
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 verified that thread.setDaemon(true);
solved endless run issue with local testing I observed.
correct, jtreg exits the process almost immediately after the main method exits. |
Ah right, that explains it. Thanks for the review! |
/integrate |
@TobiHartmann Since your change was applied there have been 47 commits pushed to the
Your commit was automatically rebased without conflicts. Pushed as commit ab2aec2. 💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored. |
C2's CCP optimization sets the type of a PhiNode to TOP because it became dead after loop unrolling. Now since that node is not reachable from the bottom due to an infinite loop at the end of the method, CCP does not enqueue the PhiNode for IGVN. As a result, the dead subgraph is not removed. During loop opts, the conditional move optimization fails on the PhiNode because its type is top. The expected behavior is to simply bail out with "COMPILE SKIPPED: infinite loop (retry at different tier)".
I suggest to fix this by simply handling a TOP Phi in the conditional move optimization code.
This issue was reported by John Jiang (johnsjiang@tencent.com).
Thanks,
Tobias
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.java.net/jdk pull/3684/head:pull/3684
$ git checkout pull/3684
Update a local copy of the PR:
$ git checkout pull/3684
$ git pull https://git.openjdk.java.net/jdk pull/3684/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 3684
View PR using the GUI difftool:
$ git pr show -t 3684
Using diff file
Download this PR as a diff file:
https://git.openjdk.java.net/jdk/pull/3684.diff