Skip to content

Commit baf3903

Browse files
authored
[AArch64] Bail out of HomogeneousPrologEpilog for functions with swif… (llvm#67417)
…tasync argument swiftasync introduces a number of frame adjustments which is incompatible with current implementation of HomogeneousPrologEpilog pass.
1 parent 31f81e9 commit baf3903

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

llvm/lib/Target/AArch64/AArch64FrameLowering.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -331,6 +331,10 @@ bool AArch64FrameLowering::homogeneousPrologEpilog(
331331
if (Exit && getArgumentStackToRestore(MF, *Exit))
332332
return false;
333333

334+
auto *AFI = MF.getInfo<AArch64FunctionInfo>();
335+
if (AFI->hasSwiftAsyncContext())
336+
return false;
337+
334338
return true;
335339
}
336340

llvm/test/CodeGen/AArch64/arm64-homogeneous-prolog-epilog.ll

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,3 +72,8 @@ declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture)
7272
; CHECK-LINUX-NEXT: ldp x22, x21, [sp, #16]
7373
; CHECK-LINUX-NEXT: ldp x29, x30, [sp], #48
7474
; CHECK-LINUX-NEXT: ret x16
75+
76+
; nothing to check - hit assert if not bailing out for swiftasync
77+
define void @swift_async(i8* swiftasync %ctx) minsize "frame-pointer"="all" {
78+
ret void
79+
}

0 commit comments

Comments
 (0)