Files
clang-p2996/llvm/lib/CodeGen/CFIInstrInserter.cpp
weiguozhi 0d471b3f64 Spill/restore FP/BP around instructions in which they are clobbered (#81048)
This patch fixes https://github.com/llvm/llvm-project/issues/17204.

If a base pointer is used in a function, and it is clobbered by an
instruction (typically an inline asm), current register allocator can't
handle this situation, so BP becomes garbage after those instructions.
It can also occur to FP in theory.

We can spill and reload FP/BP registers around those instructions. But
normal spill/reload instructions also use FP/BP, so we can't spill them
into normal spill slots, instead we spill them into the top of stack by
using SP register.
2024-08-06 16:18:20 -07:00

19 KiB