[llvm] [AArch64][Windows] Fix swift async context slot placement (PR #212922)
Saleem Abdulrasool via llvm-commits
llvm-commits at lists.llvm.org
Fri Jul 31 08:39:29 PDT 2026
================
@@ -1021,6 +1021,25 @@ void AArch64PrologueEmitter::emitFramePointerSetup(
if (CombineSPBump)
FPOffset += AFI->getLocalStackSize();
+#ifndef NDEBUG
+ // The frame record position the prologue is about to establish FP from has to
+ // agree with where MachineFrameInfo placed the saved FP object. These are
+ // computed independently -- the position here comes from
+ // computeCalleeSaveRegisterPairs, while the object offset comes from PEI --
+ // and if they disagree then the range MachineFrameInfo believes is free
+ // inside the callee-save area is not actually free, so a local scavenged into
+ // it lands on a saved register.
+ for (const CalleeSavedInfo &Info : MFI.getCalleeSavedInfo()) {
+ if (Info.getReg() != AArch64::FP || Info.isSpilledToReg())
+ continue;
+ StackOffset SavedFPOffset =
+ AFL.getFPOffset(MF, MFI.getObjectOffset(Info.getFrameIdx()));
+ assert(SavedFPOffset.getFixed() == 0 && !SavedFPOffset.getScalable() &&
+ "saved FP object does not resolve to FP+0; MachineFrameInfo and the "
+ "prologue disagree about the frame record position");
+ }
----------------
compnerd wrote:
I'm not sure I understand the value of this assertion in this code path. This really belongs in the verifier, and seems like it is check checking that the frame pointer location matches the MFI which is more generic than ARM.
https://github.com/llvm/llvm-project/pull/212922
More information about the llvm-commits
mailing list