Uh oh!
There was an error while loading. Please reload this page.
Smaller funclet prologs/epilogs (x64) - #115284
Conversation
jkotas
commented
May 4, 2025
- Allow funclets to trash non-volatile registers to make funclet prologs/epilogs smaller
- Restore non-volatile registers before non-filter funclet calls
- Unify funclet ABI between NAOT and non-NAOT
- Allow funclets to trash non-volatile registers to make funclet prologs/epilogs smaller - Restore non-volatile registers before non-filter funclet calls - Unify funclet ABI between NAOT and non-NAOT
There was a problem hiding this comment.
Pull Request Overview
This PR refactors the funclet prolog/epilog sequences for x64 to reduce their size while unifying the ABI between NAOT and non-NAOT builds.
- Removed redundant saving/restoring of non-volatile registers in funclets
- Updated stack frame allocation and alignment computations
- Adjusted documentation to reflect the revised behavior and design decisions
Reviewed Changes
Copilot reviewed 2 out of 6 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/coreclr/jit/codegenxarch.cpp | Removed EBP and callee-register save/restore logic; updated frame allocation calculation using REG_NA |
| docs/design/coreclr/botr/clr-abi.md | Revised description of register preservation behavior in funclets |
Files not reviewed (4)
- src/coreclr/nativeaot/Runtime/amd64/ExceptionHandling.S: Language not supported
- src/coreclr/nativeaot/Runtime/amd64/ExceptionHandling.asm: Language not supported
- src/coreclr/vm/amd64/AsmHelpers.asm: Language not supported
- src/coreclr/vm/amd64/asmhelpers.S: Language not supported
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
jkotas
commented
May 4, 2025
@EgorBot -windows_intel -amd usingSystem.Reflection;usingBenchmarkDotNet.Attributes;publicclassBench{staticintx;[Benchmark]publicvoidFinally(){try{try{try{try{try{try{try{try{try{try{thrownewException();}finally{x++;}}finally{x++;}}finally{x++;}}finally{x++;}}finally{x++;}}finally{x++;}}finally{x++;}}finally{x++;}}finally{x++;}}catch{}}} |
jkotas
commented
May 4, 2025
@EgorBot -windows_intel -intel usingSystem.Reflection;usingBenchmarkDotNet.Attributes;publicclassBench{staticintx;[Benchmark]publicvoidFinally(){try{try{try{try{try{try{try{try{try{try{thrownewException();}finally{x++;}}finally{x++;}}finally{x++;}}finally{x++;}}finally{x++;}}finally{x++;}}finally{x++;}}finally{x++;}}finally{x++;}}catch{}}} |
jkotas
commented
May 4, 2025
Perf results summary:
|
jkotas
commented
May 5, 2025
@janvorli @dotnet/jit-contrib PTLA. This PR is for x64 only. I plan to switch other platforms to the unified scheme in subsequent PRs. |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
BruceForstall
commented
May 5, 2025
I suggest running outerloop tests. |
jkotas
commented
May 6, 2025
/azp run runtime-coreclr outerloop |
|
Azure Pipelines successfully started running 1 pipeline(s). |