-
Notifications
You must be signed in to change notification settings - Fork 5.5k
Revisit when to use RBP frames on x64 with SysV ABI #8557
Copy link
Copy link
Closed as not planned
Labels
area-CodeGen-coreclrCLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMICLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMIenhancementProduct code improvement that does NOT require public API changes/additionsProduct code improvement that does NOT require public API changes/additionsoptimizationos-linuxLinux OS (any supported distro)Linux OS (any supported distro)tenet-performancePerformance related issuePerformance related issue
Milestone
Metadata
Metadata
Assignees
Labels
area-CodeGen-coreclrCLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMICLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMIenhancementProduct code improvement that does NOT require public API changes/additionsProduct code improvement that does NOT require public API changes/additionsoptimizationos-linuxLinux OS (any supported distro)Linux OS (any supported distro)tenet-performancePerformance related issuePerformance related issue
Type
Fields
Give feedbackNo fields configured for issues without a type.
Various comments in the code lead one to believe that on x64 with SysV ABI we always want the jit to create RBP frames (eg to facilitate simple native unwinding through managed code).
However the JIT doesn't always generate RBP frames; as best I can tell the logic for deciding is found in
rpMustCreateEBPFramewhich has a number of critera. Quite often we see RBP frames that don't really serve any useful purpose and probably don't enhance diagnosability in any substantial way.So it might make sense to revisit this and see if freeing up RBP in more cases makes sense.
For example, RBP frames frequently show up in simple IL stubs, eg
A perhaps more contentious example is found in the benchmark Benchi/Ackermann, where the extra RPB push induces an otherwise useless push of RAX, presumably to maintain frame alignment.
In heavily recursive methods like this the epilog/prolog overhead has a significant impact on performance.
category:cq
theme:prolog-epilog
skill-level:intermediate
cost:medium