8376544: [lworld] Use profiling around acmp to speculate that one operand is a value object#2237
8376544: [lworld] Use profiling around acmp to speculate that one operand is a value object#2237marc-chevalier wants to merge 11 commits intoopenjdk:lworldfrom
Conversation
|
/contributor add @TobiHartmann For the first prototype, and significant refactoring. |
|
👋 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 16 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 |
|
@marc-chevalier |
| */ | ||
|
|
||
| value class MyValue1NewAcmp { | ||
| value class MyValue1MissingOptAcmp { |
There was a problem hiding this comment.
After 8368988: [lworld] Rename classes in valhalla/inlinetypes to be distinct, the class in TestNewAcmp.java was copy-pasted here. I'm just redoing the fix as it makes my IDE complain again.
Webrevs
|
TobiHartmann
left a comment
There was a problem hiding this comment.
Looks good to me otherwise. Thanks for working on this!
|
/integrate Thanks for review! |
|
Going to push as commit 067e6d8.
Your commit was automatically rebased without conflicts. |
|
@marc-chevalier Pushed as commit 067e6d8. 💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored. |
To do
acmp, if the pointer comparison fails, we check nullity of operands, whether operands have the same class, and if this class is a value class. And if everything works, we callisSubstitutable.Currently, when we have profiling information, we use it to speculate that operands are null or of an identity class (in which case, pointer comparison is all we should do). This patch proposes to take advantage of the profiling when it hints that operands are value objects. By speculating that at least one operand is of a given value class, the call to
isSubstitutablecan be intrinsified later, and thus, spare the Java call.Speculating on one operand is enough since we will check that operands are of the same type.
Some relevant microbenchmark in
valhalla.acmp.array.Value032(in ns/op (lower is better)):Full results of micro:valhalla.acmp.array.Value032
In more details, before:After:
It is same or better.
Tested successfully with tier1-4,stress,valhalla-stress
Thanks,
Marc
Progress
Issue
Reviewers
Contributors
<thartmann@openjdk.org>Reviewing
Using
gitCheckout this PR locally:
$ git fetch https://git.openjdk.org/valhalla.git pull/2237/head:pull/2237$ git checkout pull/2237Update a local copy of the PR:
$ git checkout pull/2237$ git pull https://git.openjdk.org/valhalla.git pull/2237/headUsing Skara CLI tools
Checkout this PR locally:
$ git pr checkout 2237View PR using the GUI difftool:
$ git pr show -t 2237Using diff file
Download this PR as a diff file:
https://git.openjdk.org/valhalla/pull/2237.diff
Using Webrev
Link to Webrev Comment