================ @@ -3267,10 +3267,13 @@ bool AArch64FrameLowering::spillCalleeSavedRegisters( InsertSEH(MIB, TII, MachineInstr::FrameSetup); } else { // The code when the pair of ZReg is not present MachineInstrBuilder MIB = BuildMI(MBB, MI, DL, TII.get(StrOpc)); - if (!MRI.isReserved(Reg1)) + const AArch64RegisterInfo *RegInfo = + static_cast<const AArch64RegisterInfo *>( + MF.getSubtarget().getRegisterInfo()); + if (!RegInfo->isStrictlyReservedReg(MF, Reg1)) ---------------- aemerson wrote:
> We could unreserve LR after register allocation, I guess? That would have > roughly the right semantics. Having `getReservedRegs(MF)` return different things depending on where it's running seems worse than the bug itself. With shrink-wrapping the prolog can be in successor blocks, so LR can be live on some CFG paths and not others. https://github.com/llvm/llvm-project/pull/98073 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits