[llvm] [Codegen] Spill/Restore FP/BP under option (PR #114791)

Reid Kleckner via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 4 13:15:14 PST 2024


rnk wrote:

I agree, it's also a major flaw that LLVM doesn't diagnose or do anything about RBP conflicts. :)

FWIW, GCC just gives up. You can see in the [godbolt example](https://godbolt.org/z/evMofeesd) they say "bp cannot be used in 'asm' here". Maybe a reasonable compromise is that we emit a backend error for inline asm that clobbers BP/FP, but spill FP/BP around calls that use it.

Because of GCC's behavior, there is probably less real world code out there clobbering RBP, but there's probably a lot of generated vector kernels in inline asm that try to rely on the compiler to align the stack and do the fiddly bits of procedure linkage.

https://github.com/llvm/llvm-project/pull/114791


More information about the llvm-commits mailing list