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
8271203: C2: assert(iff->Opcode() == Op_If || iff->Opcode() == Op_CountedLoopEnd || iff->Opcode() == Op_RangeCheck) failed: Check this code when new subtype is added #4920
Conversation
|
@kelthuzadx 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.
I don't think that a LongCountedLoop
is unswitched here looking at the stack trace but it's rather chosen as unswitch If
. I had a closer look at it. It seems that the loop
for (long l1 = i; l1 < 2; ++l1) {
iArrFld[0] += 5;
}
is peeled once and then the original loop is found to be dead (because it is known that the type of the iv i
of the outer-most loop is >= 1). From this peeled iteration we only have 403 LongCountedLoopEnd
left which now just acts as a normal If
node. It looks fine to then simply use this as an unswitch if for unswitching 367 CountedLoop
. So, relaxing the assert to allow a LongCountedLoopEnd
node in dominated_by
looks good IMO.
@kelthuzadx 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 300 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.
|
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 good to me.
* @bug 8271203 | ||
* @summary C2: assert(iff->Opcode() == Op_If || iff->Opcode() == Op_CountedLoopEnd || iff->Opcode() == Op_RangeCheck) failed: Check this code when new subtype is added | ||
* @library /test/lib | ||
* @run main/othervm -Xbatch -XX:-TieredCompilation -XX:CompileOnly=UnswitchingLongCountedLoop compiler.c2.UnswitchingLongCountedLoop |
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.
Isn't that CompileOnly statement missing the package name or a wildcard?
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.
And @library /test/lib
is not needed.
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.
Hi Tobias, I've removed @library /test/lib
, also according to @chhagedorn 's analysis, I think LongCountedLoopAsUnswitchIff
should be a better test name.
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.
But the CompileOnly
statement is still missing the package name, right? No compilations will happen.
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.
Oops...Added
Hi Christian, I think you are right. As far as I see, after some loop optimizations, loop at line-17 and loop at line-19 are no longer real loops after PhaseIdealLoop2: I'm not sure why there are two same loops(B9 and B19-B22) .. but anyway, 403#LongCountedLoopEnd is located in B21, it's not a loop anymore since no backedge found and C2 treats it as a unswitch_iff. |
Thanks @chhagedorn @rwestrel and @TobiHartmann for reviews. |
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 good to me but please verify that the test reproduces the issue without your fix.
Yes, I will test if it would crash without this fix before integrating. |
Not sure which lines you refer to in your image. Lines in the JTreg test (they do not match)? And at what point is this image taken? Can you also elaborate more on what you mean by two same loops? |
JTREG TEST:
Well, the above CFG is corresponding to the last step(before beautify loops, loop.xml.log ) before crash. I haven't learned about loopopts in C2 yet, it looks like B9 and B19-22 are refer to the same loop(
...maybe that's not true. |
They probably appear to be very similar on first sight but are not. You can check the |
Make sense. TraceLoopOpts may tell me everything about what happens. I’m curious about loop optimizations, this is a good start point to explore them:P |
/integrate |
Going to push as commit 3f38a50.
Your commit was automatically rebased without conflicts. |
@kelthuzadx Pushed as commit 3f38a50. |
Hi, I'm trying to fix JDK-8271203. It's reasonable to unswitch LongCountedLoop, so relax it.
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.java.net/jdk pull/4920/head:pull/4920
$ git checkout pull/4920
Update a local copy of the PR:
$ git checkout pull/4920
$ git pull https://git.openjdk.java.net/jdk pull/4920/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 4920
View PR using the GUI difftool:
$ git pr show -t 4920
Using diff file
Download this PR as a diff file:
https://git.openjdk.java.net/jdk/pull/4920.diff