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
8260650: test failed with "assert(false) failed: infinite loop in PhaseIterGVN::optimize" #3022
Conversation
…sform_no_reclaim().
|
Webrevs
|
src/hotspot/share/opto/phaseX.cpp
Outdated
} | ||
NOT_PRODUCT( if( loop_count != 0 ) { set_progress(); } ) | ||
|
||
NOT_PRODUCT(if(loop_count != 0) { set_progress(); }) |
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.
Newline after if
is missing.
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.
You mean space? I put the space in.
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.
Yes. Thanks!
src/hotspot/share/opto/phaseX.cpp
Outdated
assert(loop_count++ < K, "infinite loop in PhaseGVN::transform"); | ||
NOT_PRODUCT(loop_count++;) | ||
#ifdef ASSERT | ||
if (loop_count >= K * C->live_nodes()) { |
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.
With old code, loop_count
would be 0
in the first iteration (due to the postfix increment), with your changes it is 2
. Is that intended? I see that you've changed <
to >=
but I still find it counter-intuitive that the loop_count
is not the actual count. Also, it's inconsistent with PhaseIterGVN::transform
where you increment after the check.
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.
Yeah, you're right it is a little sloppy. I will straighten this out. The intent is to count optimization steps. Since in transform_old
and transform_no_reclaim
, the loop is peeled to have the first apply_ideal()
happen before it, I start the loop with 1. The original code had quite a few flaws, so, don't be concerned about counting the same way, the heuristic of the limit is obviously very approximate.
@TobiHartmann, I've hopefully addressed your comments, please take another look when you have a chance. |
@veresov This change now passes all automated pre-integration checks. 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 18 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.
|
/integrate |
@veresov Since your change was applied there have been 22 commits pushed to the
Your commit was automatically rebased without conflicts. Pushed as commit 996079b. |
The test constructs a large tree of
AddINode
s that add constants to a variable. The tree is completely constant-foldable. Depending of the processing order the folding process may happen in the loop inPhaseIterGVN::transform_old()
instead of going through the worklist. That blows through the loop limit, which triggers assert. The solution is to make the loop limit proportional to the number of live nodes. I chose it to beK*live_nodes()
, which is already the limit inPhaseIterGVN::optimize()
. I also noticed the same problem inPhaseGVN::transform_no_reclaim()
and adjusted the code accordingly.Progress
Issue
Reviewers
Download
$ git fetch https://git.openjdk.java.net/jdk pull/3022/head:pull/3022
$ git checkout pull/3022