[llvm] Spill/restore FP/BP around instructions in which they are clobbered (PR #81048)
Reid Kleckner via llvm-commits
llvm-commits at lists.llvm.org
Wed Aug 7 09:56:59 PDT 2024
rnk wrote:
I think what you suggest is feasible. I would try to skip this pass under the following conditions:
* does not use base pointer (BP, but may use FP)
* has no inline asm (we already track this somewhere)
* has no FP-clobbering function calls. This is a new flag we could add to X86MachineFunctionInfo and set in X86ISelLoweringCall.cpp somewhere.
The vast majority of functions do not do both realign the stack in the prologue and adjust SP (dynamic alloca) after the prologue, necessitating a base pointer. -O0 functions do tend to have FPs, so it's worth adding an extra flag to track FP clobbering so we can early-exit in those cases. Note that the non-O0 compile time are not affected, presumably they use `fomit-frame-pointer`.
https://github.com/llvm/llvm-project/pull/81048
More information about the llvm-commits
mailing list