-
Notifications
You must be signed in to change notification settings - Fork 6.2k
8367333: C2: Vector math operation intrinsification failure #27263
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 vlivanov! A progress list of the required criteria for merging this PR into |
|
@iwanowww 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 42 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 |
|
@iwanowww |
Webrevs
|
shipilev
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.
Looks reasonable! Thanks.
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.
LGTM
Best Regards
| * -XX:+StressIncrementalInlining | ||
| * compiler.vectorapi.TestVectorMathLib |
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.
| * -XX:+StressIncrementalInlining | |
| * compiler.vectorapi.TestVectorMathLib | |
| * -XX:+StressIncrementalInlining compiler.vectorapi.TestVectorMathLib |
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.
Ok, fixed. I prefer to keep test class name on a separate line.
| /* | ||
| * @test | ||
| * @bug 8367333 | ||
| * @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.
Do you need this @requires? It might be nice to be able to run this with other compilers too.
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.
It's intended as C2-specific regression test and it relies on C2-specific VM flags. Vector API unit tests (under test/jdk/jdk/incubator/vector/) exercise the very same functionality, but don't specify flags required to trigger the bug.
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 leave it up to you. You can always ignore unrecognized flags. And tests tend to diverge over time, so maybe a little duplication would not hurt. But up to you.
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 if it is a duplication, you should probably leave a comment linking it to the other one.
Also: why not just add the extra run over at the original test?
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.
Also: why not just add the extra run over at the original test?
test/jdk/jdk/incubator/vector/*VectorTests.java are huge and already override default timeout setting. But running them with -XX:+StressIncrementalInlining does make some sense. (Maybe not by default, but as part of some stress testing configuration we have.)
| * @run main/othervm -Xbatch -XX:-TieredCompilation -XX:CompileCommand=quiet | ||
| * -XX:CompileCommand=compileonly,compiler.vectorapi.TestVectorMathLib::test* | ||
| * -XX:+StressIncrementalInlining | ||
| * compiler.vectorapi.TestVectorMathLib |
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.
Like @jatin-bhateja mentioned: alignment is off.
I'd also like to see a run without flags, maybe with only -XX:CompileCommand=compileonly,compiler.vectorapi.TestVectorMathLib::test*
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.
Again, IMO it doesn't make sense to run the regression test without stressing incremental inlining. Otherwise, it duplicates existing tests.
iwanowww
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 reviews.
| /* | ||
| * @test | ||
| * @bug 8367333 | ||
| * @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.
It's intended as C2-specific regression test and it relies on C2-specific VM flags. Vector API unit tests (under test/jdk/jdk/incubator/vector/) exercise the very same functionality, but don't specify flags required to trigger the bug.
| * @run main/othervm -Xbatch -XX:-TieredCompilation -XX:CompileCommand=quiet | ||
| * -XX:CompileCommand=compileonly,compiler.vectorapi.TestVectorMathLib::test* | ||
| * -XX:+StressIncrementalInlining | ||
| * compiler.vectorapi.TestVectorMathLib |
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.
Again, IMO it doesn't make sense to run the regression test without stressing incremental inlining. Otherwise, it duplicates existing tests.
| * -XX:+StressIncrementalInlining | ||
| * compiler.vectorapi.TestVectorMathLib |
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.
Ok, fixed. I prefer to keep test class name on a separate line.
eme64
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.
Looks reasonable.
I leave it up to you with the @requires. I was wondering why not just add the extra run with special flags to the original test? But I don't want to hold up the PR, so up to you ;)
|
Thanks for the reviews, Aleksey, Jatin, and Emanuel. /integrate |
|
Going to push as commit aa36799.
Your commit was automatically rebased without conflicts. |
As part of JDK-8353786, C2 support for operations backed by the vector math library was completely removed. On JDK side, there is a special dispatching logic added to avoid intrinsic calls in
jdk.internal.vm.vector.VectorSupport. But it's still possible to observe such paradoxical situations (intrinsic calls with obsolete operation IDs) when processing effectively dead code.Consider
FloatVector::lanewiseTemplate:At runtime,
unaryMathOpis unconditionally invoked, but during compilation it's possible to end up with an intrinsification attempt ofVectorSupport.unaryOp()beforeopKind(op, VO_SPECIAL)is inlined.It can be reliably reproduced
-XX:+StressIncrementalInliningflag.The fix is to fail-fast intrinsification rather than crashing the VM.
Testing: tier1 - tier4
Progress
Issue
Reviewers
Reviewing
Using
gitCheckout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/27263/head:pull/27263$ git checkout pull/27263Update a local copy of the PR:
$ git checkout pull/27263$ git pull https://git.openjdk.org/jdk.git pull/27263/headUsing Skara CLI tools
Checkout this PR locally:
$ git pr checkout 27263View PR using the GUI difftool:
$ git pr show -t 27263Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/27263.diff
Using Webrev
Link to Webrev Comment