8354348: Enable Extended EVEX to REX2/REX demotion for commutative operations with same dst and src2#26997
8354348: Enable Extended EVEX to REX2/REX demotion for commutative operations with same dst and src2#26997vamsi-parasa wants to merge 9 commits intoopenjdk:masterfrom
Conversation
…erations with same dst and src2
|
👋 Welcome back sparasa! A progress list of the required criteria for merging this PR into |
|
@vamsi-parasa 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 192 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 |
|
@vamsi-parasa 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
|
|
Hi @vamsi-parasa , thanks for working on this, I am process of validating #26283 and find that additional RA biasing will enable demotion for more cases, with a minimal test case I see following results Test point:- |
src/hotspot/cpu/x86/x86_64.ad
Outdated
| instruct addI_rReg_mem_rReg_ndd(rRegI dst, memory src1, rRegI src2, rFlagsReg cr) | ||
| %{ | ||
| predicate(UseAPX); | ||
| match(Set dst (AddI (LoadI src1) src2)); |
There was a problem hiding this comment.
Will this not be covered by the pattern at line 7103, since ADLC automatically generates a DFA to handle both cases?
There was a problem hiding this comment.
Will run experiments to make sure that the RegRegMem pattern also applies to RegMemReg case and remove the newly added match rules if they're redundant. Will update you soon.
There was a problem hiding this comment.
Hi @vamsi-parasa, your latest patch does not address this.
There was a problem hiding this comment.
Hi Jatin (@jatin-bhateja), please see the latest update which removed the unnecessary match rules for RegMemReg case.
Hi Jatin (@jatin-bhateja), thank you for sharing the information about the register allocation biasing PR you're working on that will improve demotion. |
|
Hi Emanuel (@eme64), Could you please run the tests for this PR? Thanks, |
jatin-bhateja
left a comment
There was a problem hiding this comment.
Hi @vamsi-parasa , Thanks for addressing my comments.
|
@vamsi-parasa Quickly scanned the patch, looks reasonable. Launching tests 🚀 |
Hi Emanuel (@eme64), could you please let me know if the tests passed? |
eme64
left a comment
There was a problem hiding this comment.
Not reviewed in detail, but looks reasonable.
Tests pass :)
Thank you Emanuel! :) |
|
/integrate |
|
Going to push as commit c41add8.
Your commit was automatically rebased without conflicts. |
|
@vamsi-parasa Pushed as commit c41add8. 💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored. |
|
/backport openjdk/jdk25u |
|
@vamsi-parasa the backport was successfully created on the branch backport-vamsi-parasa-c41add8d-master in my personal fork of openjdk/jdk25u. To create a pull request with this backport targeting openjdk/jdk25u:master, just click the following link: The title of the pull request is automatically filled in correctly and below you find a suggestion for the pull request body:
If you need to update the source branch of the pull then run the following commands in a local clone of your personal fork of openjdk/jdk25u: |




This change extends Extended EVEX (EEVEX) to REX2/REX demotion for Intel APX NDD instructions to handle commutative operations when the destination register and the second source register (src2) are the same.
Currently, EEVEX to REX2/REX demotion is only enabled when the first source (src1) and the destination are the same. This enhancement allows additional cases of valid demotion for commutative instructions (add, imul, and, or, xor).
For example:
eaddl r18, r25, r18can be encoded asaddl r18, r25using APX REX2 encodingeaddl r2, r7, r2can be encoded asaddl r2, r7using non-APX legacy encodingProgress
Issue
Reviewers
Reviewing
Using
gitCheckout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/26997/head:pull/26997$ git checkout pull/26997Update a local copy of the PR:
$ git checkout pull/26997$ git pull https://git.openjdk.org/jdk.git pull/26997/headUsing Skara CLI tools
Checkout this PR locally:
$ git pr checkout 26997View PR using the GUI difftool:
$ git pr show -t 26997Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/26997.diff
Using Webrev
Link to Webrev Comment