-
Notifications
You must be signed in to change notification settings - Fork 6.2k
8319764: C2 compilation asserts during incremental inlining because Phi input is out of bounds #16648
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
|
| * @run main/othervm -XX:-TieredCompilation -XX:-BackgroundCompilation -XX:CompileCommand=dontinline,TestLateInlineReplacedNodesExceptionPath::notInlined | ||
| * -XX:+StressIGVN -XX:StressSeed=1246687813 TestLateInlineReplacedNodesExceptionPath | ||
| * @run main/othervm -XX:-TieredCompilation -XX:-BackgroundCompilation -XX:CompileCommand=dontinline,TestLateInlineReplacedNodesExceptionPath::notInlined | ||
| * -XX:+StressIGVN TestLateInlineReplacedNodesExceptionPath |
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.
VM option 'StressIGVN' is diagnostic and must be enabled via -XX:+UnlockDiagnosticVMOptions.
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 looking at this. Fixed in the new commit.
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. Could you elaborate on why this wasn't an issue before JDK-8312980?
|
@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 94 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 |
| if (in != nullptr && !in->is_top()) { | ||
| if (is_dominator(ctl, 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.
Ifs can be merged.
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.
Done in new commit.
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.
That looks reasonable to me, too!
test/hotspot/jtreg/compiler/inlining/TestLateInlineReplacedNodesExceptionPath.java
Outdated
Show resolved
Hide resolved
| * bug 8319764 | ||
| * @summary C2 compilation asserts during incremental inlining because Phi input is out of bounds | ||
| * @run main/othervm -XX:-TieredCompilation -XX:-BackgroundCompilation -XX:CompileCommand=dontinline,TestLateInlineReplacedNodesExceptionPath::notInlined | ||
| * -XX:+UnlockDiagnosticVMOptions -XX:+StressIGVN -XX:StressSeed=1246687813 TestLateInlineReplacedNodesExceptionPath |
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.
Since StressIGVN is C2 specific, you should add a @requires vm.compiler2.enabled.
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.
Done in new commit.
| if (is_dominator(ctl, in)) { | ||
| valid_control.set(in->_idx); | ||
| collect_nodes_to_clone(stack, to_fix); | ||
| if (n->req() == region->req()) { // dead phi? |
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 you can change this comment to "ignore dead phis".
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.
Done in new commit.
Logic was quite different: it would go over the phi inputs looking for one that was of interest and then only looked at the region's input for that phi input so a phi with fewer inputs than the region wasn't an issue. |
…esExceptionPath.java Co-authored-by: Christian Hagedorn <christian.hagedorn@oracle.com>
Thanks for reviewing and making suggestions. |
TobiHartmann
left a comment
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 explanation. Looks good.
chhagedorn
left a comment
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.
Still looks good
test/hotspot/jtreg/compiler/inlining/TestLateInlineReplacedNodesExceptionPath.java
Outdated
Show resolved
Hide resolved
…esExceptionPath.java Co-authored-by: Christian Hagedorn <christian.hagedorn@oracle.com>
|
@TobiHartmann @chhagedorn thanks for the reviews. |
|
/integrate |
|
Going to push as commit f33c874.
Your commit was automatically rebased without conflicts. |
In the test case:
lateInlined1()andlateInlined2()are inlined incrementallybecause they are invoked wih a method handle which is known constant
only after igvn. For the failure to reproduce,
lateInlined2()mustbe inlined after
lateInlined1()which depends on igvn processingorder (that's why the test needs
StressIGVN).lateInlined1()has 2virtual calls that are inlined with bimorphic inlining. At each call
site, exception state is merged from
A.m()andB.m(), the 2methods that are inlined.
cis casted to non null inA.m(). At thefirst call site,
cis live and merging the exception states causesthe creation of a
Phiforcthat mergescand the cast to nonnull of
c. At the second call site,cis not live so it's ignoredwhen merging exception states. When the exception states for the 2
call sites are combined, the region that merges the states at the
first call site is extended to have 4 inputs but the
Phiforcatthe first call site is left with 2 inputs. When
lateInlined2()isinlined, it records a replaced node for a cast of
cto non null. Oncompletion of incremental inlining, that replaced nodes is "applied".
In the process, the dead
Phiforccreated at the previousincremental inline is found and because it has less inputs that its
region, the crash occurs.
The fix I propose is to simply ignore phi nodes that don't have the
same number of inputs as their region because they can only be a dead
Phi.
Progress
Issue
Reviewers
Reviewing
Using
gitCheckout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/16648/head:pull/16648$ git checkout pull/16648Update a local copy of the PR:
$ git checkout pull/16648$ git pull https://git.openjdk.org/jdk.git pull/16648/headUsing Skara CLI tools
Checkout this PR locally:
$ git pr checkout 16648View PR using the GUI difftool:
$ git pr show -t 16648Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/16648.diff
Webrev
Link to Webrev Comment