-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
[JIT] [APX] Enable additional General Purpose Registers. #108799
Draft
DeepakRajendrakumaran
wants to merge
69
commits into
dotnet:main
Choose a base branch
from
DeepakRajendrakumaran:enableeGPR
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
[JIT] [APX] Enable additional General Purpose Registers. #108799
DeepakRajendrakumaran
wants to merge
69
commits into
dotnet:main
from
DeepakRajendrakumaran:enableeGPR
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Update comments. Merge the REX2 changes into the original legacy emit path bug fix: Set REX2.W with correct mask code. register encoding and prefix emitting logics. Add REX2 prefix emit logic bug fixes Add Stress mode for REX2 encoding and some bug fixes resolve comments: 1. add assertion check for UD opcodes. 2. add checks for EGPRs. Add REX2 to emitOutputAM, and let LEA to be REX2 compatible. Add REX2.X encoding for SIB byte But fixes: add REX2 prefix on the path in RI where MOV is specially handled. Enable REX2 encoding for `movups` fixed bugs in REX2 prefix emitting logic when working with map 1 instructions, and enabled REX2 for POPCNT legacy map index-er bug fixes some clean-up Adding initial APX unit testing path. Adding a coredistools dll that has LLVM APX disasm capability. It must be coppied into a CORE_ROOT manually. clean up work for REX2 narrow the REX2 scope to `sub` only some clean up based on the comments. bug fix resolve comment
- SV path is mostly for debugging purposes Added encoding unit tests for instructions with immediates
Code refactoring: AddX86PrefixIfNeeded.
… missing in JIT, may indicate these instructions are not being used in JIT, drop them for now.
…lled before adding any prefix.
Refactor REX2 encoding stress logics.
(this will have side effect that the estimated code will go up and mismatch with actual code size.)
DeepakRajendrakumaran
force-pushed
the
enableeGPR
branch
from
November 12, 2024 20:05
ced2d3e
to
eb47ede
Compare
DeepakRajendrakumaran
force-pushed
the
enableeGPR
branch
from
November 19, 2024 01:31
eb47ede
to
ec3388f
Compare
This was referenced Nov 19, 2024
DeepakRajendrakumaran
force-pushed
the
enableeGPR
branch
from
November 19, 2024 22:24
ec3388f
to
662de71
Compare
DeepakRajendrakumaran
force-pushed
the
enableeGPR
branch
from
November 19, 2024 23:53
a3e8331
to
6bbccb4
Compare
Now that CPUID changes have merged, ran superpmi TP and I have a problem Ran the scripts shared by Kunal a while back to debug why this is happening The following is for libraries
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
apx
Related to the Intel Advanced Performance Extensions (APX)
area-CodeGen-coreclr
CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI
community-contribution
Indicates that the PR has been added by a community member
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR is built on top of #108796
What this PR does
Link to related commit
Link to related commit
Link to related commit
Link to related commit
Link to related commit
Testing
src/tests/JIT
) using Ruihan's scriptsrc/tests/JIT
using altjit featureAnalysis of superpmi results
Summary from JitAnalyze
Detail diffs
Why arm tests from
\HardwareIntrinsics\Arm\AdvSimd\AdvSimd_ro\AdvSimd_ro.dasm
show up here and generates x86 code. My theory is that since we are compiling for x86 using aljit, it takes the software fallback path for arm instrinsics and generates x86 code. See how IsSupported() is generating false belowI'm ignoring these for now
Some interesting code samples highlighting changes introduced due to enabling additional GPRs
Case 1
A very simple case with r16 being used
see
V03 loc0
In this case, a spill is reduced and we see instruction reduction. The cost of using this eGPR is slightly higher encoding size with Rex2. We do not add this to the calculus while doing reg allocation
Case 2
An example of lack of eEVEX/instructions not having eGPR support causing regression
In this example, we use
imul
. We currently have not enabled eGPR usage forimul
. This means if the input toimul
is in an eGPR, we insert amov
to move it to a lower GPR. This further adds to register usage