- Notifications
You must be signed in to change notification settings - Fork5.2k
Skip FP registers processing if method don't have floating points use#85744
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
ghost commentedMay 4, 2023
Tagging subscribers to this area:@JulieLeeMSFT,@jakobbotsch Issue Detailsnull
|
src/coreclr/jit/lsra.h Outdated
| unsignedintcurrentSpill[TYP_COUNT]; | ||
| boolneedFloatTmpForFPCall; | ||
| boolneedDoubleTmpForFPCall; | ||
| boolneedFloatingRegisters; |
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.
A safe change would be to haveneedFloatingRegisters |= (theRegisterType != IntRegisterType); innewInterval() method but want to see if my current changes achieve the purpose.
kunalspathak commentedMay 4, 2023
NiceTP Diffs |
kunalspathak commentedMay 4, 2023
/azp run runtime-coreclr jitstress-jitstressregs, runtime-coreclr jitstress |
| Azure Pipelines successfully started running 1 pipeline(s). |
Uh oh!
There was an error while loading.Please reload this page.
tannergooding commentedMay 4, 2023 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Do we know what causes the potential hit to Arm64 minopts? Seems odd that we see such huge improvements elsewhere, but not always in minopts but only on Arm64 I see |
kunalspathak commentedMay 4, 2023
Jitstress is green. |
kunalspathak commentedMay 4, 2023
I will try to find it out. |
kunalspathak commentedMay 4, 2023
@dotnet/jit-contrib |
kunalspathak commentedMay 5, 2023
kunalspathak commentedMay 5, 2023
It also occurred to me that for xarch, we already updated the definition of |
| // For that `compFloatingPointUsed` should be set accurately | ||
| // before invoking allocator. |
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.
I think this bit in particular is a bit difficult as we need to pre-emptively setcompFloatingPointUsed for any SIMD code. But that can't really account for dead code elimination or other factors that might later remove or transforms the nodes to no longer need it.
tannergoodingMay 5, 2023 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
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.
Would it instead be possible to haveregMaskTP LinearScan::internalFloatRegCandidates() lazily do the below, or is there other factors that require it?
That is, have it do something like:
regMaskTPLinearScan::internalFloatRegCandidates(){if (!needNonIntegerRegisters) {// lazily initialize fpreg state herefor (unsignedint i =0; i < lsraRegOrderFltSize; i++) { regNumber reg = lsraRegOrderFlt[i]; RegRecord* curr = &physRegs[reg]; curr->regOrder = (unsignedchar)i; } needNonIntegerRegisters =true; }if (compiler->compFloatingPointUsed) {return availableFloatRegs; }else {return RBM_FLT_CALLEE_TRASH; }}
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.
Unfortunately we need the physRegRecord early right after identifying candidates.
kunalspathakMay 5, 2023 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
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.
But that can't really account for dead code elimination or other factors that might later remove or transforms the nodes to no longer need it.
True, but this is the best we can do I suppose, unless you are proposing to just start from scratch in LSRA and set it totrue duringBuildNode() iftree->GetType() != TYP_INT.
Edit: Doing the check inBuildNode() might prove costly though because we will be doing that for every singleGenTree* node and not sure how many cases we will optimize for the scenarios where we didn't account for dead code elimination.



Uh oh!
There was an error while loading.Please reload this page.
Fixes:#83109
Contributes to#83946