Skip to content
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

8264586: [lworld] C2 compilation fails due to infinite loop in PhaseIterGVN::optimize #377

Closed
wants to merge 1 commit into from

Conversation

@TobiHartmann
Copy link
Member

@TobiHartmann TobiHartmann commented Apr 6, 2021

The problem is an InlineTypePtrNode that becomes dead after CCP removes a redundant null check and then keeps several other nodes alive. Since we don't run any loop opts anymore after CCP, the dead subgraph is not removed and the dead nodes are also not re-processed by PhaseCCP::transform_once to update their bottom types. As a result, two LoadNodes only used by a ValueTypePtrNode end up with types that are inconsistent with their bottom types and are re-enqueued for IGVN indefinitely by this code:

if (can_reshape && igvn != NULL &&
(igvn->_worklist.member(address) ||
(igvn->_worklist.size() > 0 && t_adr != adr_type())) ) {
// The address's base and type may change when the address is processed.
// Delay this mem node transformation until the address is processed.
igvn->_worklist.push(this);
return NodeSentinel; // caller will return NULL

I think we should aggressively remove InlineTypePtrNodes if they are no longer needed to keep track of the individual field values. I've added an Ideal transformation to take care of that.

The patch also includes a fix for an unrelated "Control flow was added although the intrinsic bailed out" failure and some cleanup/refactoring.

Thanks,
Tobias


Progress

  • Change must not contain extraneous whitespace

Issue

  • JDK-8264586: [lworld] C2 compilation fails due to infinite loop in PhaseIterGVN::optimize

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.java.net/valhalla pull/377/head:pull/377
$ git checkout pull/377

Update a local copy of the PR:
$ git checkout pull/377
$ git pull https://git.openjdk.java.net/valhalla pull/377/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 377

View PR using the GUI difftool:
$ git pr show -t 377

Using diff file

Download this PR as a diff file:
https://git.openjdk.java.net/valhalla/pull/377.diff

@bridgekeeper
Copy link

@bridgekeeper bridgekeeper bot commented Apr 6, 2021

👋 Welcome back thartmann! A progress list of the required criteria for merging this PR into lworld will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk
Copy link

@openjdk openjdk bot commented Apr 6, 2021

@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:

8264586: [lworld] C2 compilation fails due to infinite loop in PhaseIterGVN::optimize

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 no new commits pushed to the lworld branch. If another commit should be pushed before you perform the /integrate command, your PR will be automatically rebased. If you prefer to avoid any potential automatic rebasing, please check the documentation for the /integrate command for further details.

➡️ To integrate this PR with the above commit message to the lworld branch, type /integrate in a new comment.

@mlbridge
Copy link

@mlbridge mlbridge bot commented Apr 6, 2021

Webrevs

@TobiHartmann
Copy link
Member Author

@TobiHartmann TobiHartmann commented Apr 6, 2021

/integrate

@openjdk openjdk bot closed this Apr 6, 2021
@openjdk openjdk bot added integrated and removed ready rfr labels Apr 6, 2021
@openjdk
Copy link

@openjdk openjdk bot commented Apr 6, 2021

@TobiHartmann Pushed as commit 937f9b3.

💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
1 participant