-
Notifications
You must be signed in to change notification settings - Fork 6.1k
8306706: Support out-of-line code generation for MachNodes #13602
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 qamai! A progress list of the required criteria for merging this PR into |
@merykitty 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
|
With this patch, the compiled code for a float-to-int conversion is changed:
And there are slight improvements shown in microbenchmarks, although the result differs run-to-run, the patched version seems to be generally more performant:
|
The generated node for the stub looks like this:
And the corresponding node's
|
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.
Great work. I'm just wondering if the extra complexity is justified for optimizing only the floating point conversions. Do you plan to use this for other optimizations?
@TobiHartmann Thanks for taking a look, I think this can be used for the vectorized version of these nodes, as well as the max, min nodes for floating point numbers. I also see compact header uses out-of-line code to slow path |
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.
Is it possible to do this in c2_MacroAssembler_x86
instead (as for verified_entry
)?
We are trying to move complex coding from .ad files to macroassembler.
@vnkozlov Yes we can explicitly define a stub without relying on code generation, it may be more preferable since it avoids adding complexity to adlc generation. The only downside is that there is some boilerplate for each usage but I think the boilerplate is not too terrible. |
Can you look on that? There could be other cases in Macroassembler which can use this |
@merykitty Please do not rebase or force-push to an active PR as it invalidates existing review comments. Note for future reference, the bots always squash all changes into a single commit automatically as part of the integration. See OpenJDK Developers’ Guide for more information. |
@TobiHartmann @vnkozlov I have reworked the patch, now it relies on template instead of adlc generation to achieve the desired behaviours, I think this is a much more preferable approach. |
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.
Clever. Let me test it.
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.
My testing passed. Good.
@merykitty 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 83 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 |
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.
Nice! The new version looks good to me.
@vnkozlov Thanks for your reviews and testing |
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.
Good.
/integrate |
Going to push as commit ab241b3.
Your commit was automatically rebased without conflicts. |
@merykitty Pushed as commit ab241b3. 💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored. |
} | ||
} | ||
|
||
auto stub = C2CodeStub::make<Register, XMMRegister, address>(dst, src, slowpath_target, 23, convertF2I_slowpath); |
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 @merykitty, could you please explain how the size 23 was computed? This value does not work with APX and I created a PR (#25787) for that.
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.
@vamsi-parasa Hi, I just manually assembled the snippet and see its size, for such a small snippet it is easy to see that the size is indeed the largest possible.
Hi,
This patch adds supports for MachNodes to emit an out-of-line piece of code in the stub section of the compiled method. This allows the separation of the uncommon path from the common one, which speeds up the common path a little bit and increases compiled code density. Please take a look and leave reviews.
Thanks a lot.
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/13602/head:pull/13602
$ git checkout pull/13602
Update a local copy of the PR:
$ git checkout pull/13602
$ git pull https://git.openjdk.org/jdk.git pull/13602/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 13602
View PR using the GUI difftool:
$ git pr show -t 13602
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/13602.diff
Webrev
Link to Webrev Comment