Repository navigation
Support Lower to reserve internal register(s) different from targetReg. - #7285
Conversation
|
@dotnet-bot test Windows_NT jitstress2 |
|
@dotnet-bot test Windows_NT corefx_baseline |
|
@RussKeldorph @jashook @adiaaida - For the last 2-3 weeks whenever I invoked Window_NT/Ubuntu corefx_baseline job, it is failing in build stage itself. Is it broken and a known thing? |
|
@mmitche Do you know anything about the corefx_baseline jobs? |
|
@CarolEidt - Please review this. |
|
@adiaaida nope |
| isTgtPref = false; | ||
| regOptional = false; | ||
| definesAnyRegisters = false; | ||
| internalRegDifferentFromTarget = false; |
There was a problem hiding this comment.
Suggestion: it might be good to name this isInternalRegDelayFree to highlight its similarity (in both requirement, i.e. that it differ from the target, an in implementation. #Resolved
There was a problem hiding this comment.
| } | ||
| else | ||
| { | ||
| // Here we don't need internal reg to be different from targetReg. |
There was a problem hiding this comment.
Suggestion: It seems odd to mention this here, since that's the default case. If you feel it is necessary to mention it, I would say "Here we simply need a normal internal register, which must be different from any of the operand's registers, but may be the same as targetReg" #Resolved
There was a problem hiding this comment.
| // Non-const No 2 (regCnt and tmpReg for subtracting from sp) | ||
| // | ||
| // Note: Here we don't need internal register to be different from targetReg | ||
| // rather, require it to be different from operand's reg. |
There was a problem hiding this comment.
Please put a "." after "targetReg" and capitalize "Rather". And you might say "Rather, we simply need it to be different from the operand's reg, as usual." #Resolved
There was a problem hiding this comment.
| // const and >=PageSize No 2 | ||
| // Non-const Yes 0 | ||
| // Non-const No 2 | ||
| // (x86:tmpREg for sutracting from esp) |
There was a problem hiding this comment.
|
|
|
@dotnet-bot test Windows_NT formatting please |
|
Formatting changes that @adiaaida checked-in caused caused a conflict in lsra.cpp. Pushed new changes after the merge. |
|
I'll take a look at the corefx jobs. They've never been completely green, but failures have crept in recently. |
|
@erozenfeld, @adiaaida - formatting tool is complaining about ssabuilder.cpp which my PR hasn't touched. Changes to this file were checked-in by @erozenfeld. |
|
@sivarv Yep. I have a PR out for that. |
|
@dotnet-bot test Windows_NT x64 Formatting please |
Support Lower to reserve internal register(s) different from targetReg. Commit migrated from dotnet/coreclr@d599d61
There are quite a few cases in codegen that need internal registers (float or int). In some cases, lower/codegen need an internal register(s) to be different from target reg. To achieve it lower/codegen reserve two internal registers. The reason is that internal register uses end before the target reg gets defined and hence there is no guarantee that a single internal register requested is different from target reg. Reserving more registers than required in some cases lead to wasting a register.
These code changes are meant to allow lower/codegen to specify if it needs a register different from target reg while reserving internal registers. This is achieved by making Use position of internal register to interfere with Def of target Reg by marking Use position as isDelayRegFree=true.
I have made the Lower/Codegen side changes for xarch. It turns out most of the reg savings are in SIMD codegen paths. I am going to open a git issue for doing lower/codegen side changes for arm64.
Asm Diffs:
Fx assemblies show no diff as expected.
CqPerf - Ray tracer and one method of SharpChess got impacted. Overall 10 bytes of size win.
SIMD tests - some code size wins and some losses due to additional moves that materialized due to register allocation changing. Overall a minor 21 bytes of code size loss across all SIMD tests.
Perf Execution numbers:
Raytracer - improved by 3% (Before: 5911 After: 5717)
SharpChess - execution number within noise and remained the same.