-
Notifications
You must be signed in to change notification settings - Fork 143
8374122: [lworld] compiler/c2/cmove/TestScalarConditionalMoveCmpObj.java fails with ir mismatches when preview enabled, post jdk-27+3 #1934
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
base: lworld
Are you sure you want to change the base?
Conversation
|
👋 Welcome back mchevalier! A progress list of the required criteria for merging this PR into |
|
@marc-chevalier 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 128 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 |
merykitty
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.
LGTM
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.
Looks good to me too!
The test
TestScalarConditionalMoveCmpObj.javatests whether code such aswhere
aandbareObject[]gives aCMoveNode. Without Valhalla, we get a simpleIf -> If(True|False) -> Regiondiamondthat is simplified as a CMove.
Only this simple shape is simplified:
valhalla/src/hotspot/share/opto/loopopts.cpp
Lines 723 to 730 in a4fb7eb
But with Valhalla, since operands could be value objects, the logic is a lot more complex: are pointer equal? If not, are one of both operands null? If both aren't null, are the operand the same class? If so... All being eventually concluded with a call to
isSubstitutable. This can't be simplified as aCMove(or not easily).Even warm up isn't enough: while
a[i]andb[i]are guessed to be exactlyObject, this still requires a more complex logic than a diamond. Schematically: are pointers equal? If not, is lhs null (that is enough to conclude they are different objects)? If so, trap; if not, is lhs of the speculated (non-value) type? If so, they are different; if not, trap. That is too complicated to make aCMove.A solution is to make sure we can prove, rather than speculate, that operands are not value objects. Instead of making
aandbarrays ofObjectthat can be value types at runtime, we make them arrays of a non-abstract non-value type. This cannot be derived into a value class, so it's fine. And the test pass again!I've also done a bit of side fixup in these tests: fixing package name and call
initon the arrays used for theintflavor of the test (methodprivate static void TestScalarConditionalMoveCmpObj::init(int[] a)was suspiciously unused).Thanks,
Marc
Progress
Issue
Reviewers
Reviewing
Using
gitCheckout this PR locally:
$ git fetch https://git.openjdk.org/valhalla.git pull/1934/head:pull/1934$ git checkout pull/1934Update a local copy of the PR:
$ git checkout pull/1934$ git pull https://git.openjdk.org/valhalla.git pull/1934/headUsing Skara CLI tools
Checkout this PR locally:
$ git pr checkout 1934View PR using the GUI difftool:
$ git pr show -t 1934Using diff file
Download this PR as a diff file:
https://git.openjdk.org/valhalla/pull/1934.diff
Using Webrev
Link to Webrev Comment