[llvm] 769ced3 - AArch64: mark x22 livein if it's an async context that gets stored.
Tim Northover via llvm-commits
llvm-commits at lists.llvm.org
Mon May 17 03:56:09 PDT 2021
Author: Tim Northover
Date: 2021-05-17T11:56:03+01:00
New Revision: 769ced3d576bef1098c1e5819d4afeb9eee4d6bd
URL: https://github.com/llvm/llvm-project/commit/769ced3d576bef1098c1e5819d4afeb9eee4d6bd
DIFF: https://github.com/llvm/llvm-project/commit/769ced3d576bef1098c1e5819d4afeb9eee4d6bd.diff
LOG: AArch64: mark x22 livein if it's an async context that gets stored.
This fixes a crash with expensive checks enabled (the verifier was not happy).
Added:
Modified:
llvm/lib/Target/AArch64/AArch64FrameLowering.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Target/AArch64/AArch64FrameLowering.cpp b/llvm/lib/Target/AArch64/AArch64FrameLowering.cpp
index 64ad462da9ed..7ef3007c9791 100644
--- a/llvm/lib/Target/AArch64/AArch64FrameLowering.cpp
+++ b/llvm/lib/Target/AArch64/AArch64FrameLowering.cpp
@@ -1270,7 +1270,8 @@ void AArch64FrameLowering::emitPrologue(MachineFunction &MF,
// record, so store it now.
const auto &Attrs = MF.getFunction().getAttributes();
bool HaveInitialContext = Attrs.hasAttrSomewhere(Attribute::SwiftAsync);
-
+ if (HaveInitialContext)
+ MBB.addLiveIn(AArch64::X22);
BuildMI(MBB, MBBI, DL, TII->get(AArch64::StoreSwiftAsyncContext))
.addUse(HaveInitialContext ? AArch64::X22 : AArch64::XZR)
.addUse(AArch64::SP)
More information about the llvm-commits
mailing list