[llvm] Fix an assert failure with a funclet in a swifttailcc function. (PR #78806)

Saleem Abdulrasool via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 19 15:54:52 PST 2024


================
@@ -2590,9 +2590,11 @@ StackOffset AArch64FrameLowering::resolveFrameOffsetReference(
         // via the frame pointer, so we have to use the FP in the parent
         // function.
         (void) Subtarget;
+        // swifttailcc uses FP
         assert(
-            Subtarget.isCallingConvWin64(MF.getFunction().getCallingConv()) &&
-            "Funclets should only be present on Win64");
+            (Subtarget.isCallingConvWin64(MF.getFunction().getCallingConv()) ||
+             MF.getFunction().getCallingConv() == CallingConv::SwiftTail) &&
+            "Funclets should only be present on Win64 or swifttailcc");
----------------
compnerd wrote:

What happens if I have a `swiftcc` function? Is there a reason that loosening the assertion like this is appropriate?

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


More information about the llvm-commits mailing list