[llvm] [X86] Don't emit x87 register scrub when x87 is unavailable (PR #211146)
Phoebe Wang via llvm-commits
llvm-commits at lists.llvm.org
Wed Jul 22 07:28:51 PDT 2026
================
@@ -610,6 +610,12 @@ BitVector X86RegisterInfo::getReservedRegs(const MachineFunction &MF) const {
for (unsigned n = 0; n != 8; ++n)
Reserved.set(X86::ST0 + n);
+ // When x87 is unavailable (e.g. -mno-x87 / -msoft-float), the FPn stackifier
+ // pseudo-registers can't hold a value; keep them out of the allocatable set.
+ if (ST.useSoftFloat() || !ST.hasX87())
+ for (MCPhysReg Reg : X86::RFP80RegClass)
----------------
phoebewang wrote:
Use `X86::FP0 + n` to follow convention around.
https://github.com/llvm/llvm-project/pull/211146
More information about the llvm-commits
mailing list