jdk
jdk copied to clipboard
8291466: C2: assert(false) failed: infinite loop in PhaseIterGVN::transform_old with -XX:+StressIGVN
Recently, an igvn infinite loop issue was reported. Git bisection shows it appears after our JDK-8289996 patch. But after that patch is backed out, we find similar test still fails. We have attached a jtreg case to reproduce this issue.
The ideal graph of the problematic method has a MulINode
multiplying a
PhiNode
by a ConINode
. For better optimizations, MulINode::Ideal()
moves the constant input to the right hand side. And Ideal()
function
in its parent class MulNode
has the similar logic. In some code paths,
MulINode::Ideal()
calls MulNode::Ideal()
. The problem here is that,
MulINode
and MulNode
use different ways to check constant. One calls
type->singleton()
and the other calls node->find_int_con(val)
which
accepts constant in PhiNode
. So in some corner cases where a PhiNode
can be evaluated to a constant, the two inputs of the MulNode
will be
swapped back and forth in Ideal()
calls. It eventually causes the igvn
infinite loop issue.
This patch removes the swap_edges()
logic in MulINode
and MulLNode
because it's enough to do this by calling MulNode::Ideal()
. We also do
some code cleanup in this patch as we have done in JDK-8289996.
Tested hotspot::hotspot_all_no_apps, jdk::tier1~3 and langtools::tier1.
Progress
- [ ] Change must be properly reviewed (1 review required, with at least 1 Reviewer)
- [x] Change must not contain extraneous whitespace
- [x] Commit message must refer to an issue
Issue
- JDK-8291466: C2: assert(false) failed: infinite loop in PhaseIterGVN::transform_old with -XX:+StressIGVN
Reviewing
Using git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk pull/9820/head:pull/9820
$ git checkout pull/9820
Update a local copy of the PR:
$ git checkout pull/9820
$ git pull https://git.openjdk.org/jdk pull/9820/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 9820
View PR using the GUI difftool:
$ git pr show -t 9820
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/9820.diff
:wave: Welcome back pli! 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.
@pfustc The following label will be automatically applied to this pull request:
-
hotspot
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.
/cc hotspot-compiler
@pfustc
The hotspot-compiler
label was successfully added.
Webrevs
- 03: Full (aa609c3d)
- 02: Full - Incremental (1e455e31)
- 01: Full - Incremental (7272ce10)
- 00: Full (8ca74190)
PING. Any reviewer can help look at this? @shipilev
@pfustc 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:
8291466: C2: assert(false) failed: infinite loop in PhaseIterGVN::transform_old with -XX:+StressIGVN
Reviewed-by: roland, 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 1 new commit pushed to the master
branch:
- d5167a91a9d35afba1a2f246f9d320f1cbb998b2: 7189422: [macosx] Submenu's arrow have a wrong position
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.
@pfustc this pull request can not be integrated into master
due to one or more merge conflicts. To resolve these merge conflicts and update this pull request you can run the following commands in the local repository for your personal fork:
git checkout igvn
git fetch https://git.openjdk.org/jdk master
git merge FETCH_HEAD
# resolve conflicts and follow the instructions given by git merge
git commit -m "Merge master"
git push
@chhagedorn Thanks for your review. Currently this patch has conflicts with jdk master. I will try a merge and then do the minor fixes as you suggested.
/integrate
Going to push as commit a88a9e344f66bca21f3a01dbbcea19b52af14865.
Since your change was applied there has been 1 commit pushed to the master
branch:
- d5167a91a9d35afba1a2f246f9d320f1cbb998b2: 7189422: [macosx] Submenu's arrow have a wrong position
Your commit was automatically rebased without conflicts.
@pfustc Pushed as commit a88a9e344f66bca21f3a01dbbcea19b52af14865.
:bulb: You may see a message that your pull request was closed with unmerged commits. This can be safely ignored.