Skip to content

Commit 3e472be

Browse files
authored
Merge pull request #2280 from TNorthover/eng/PR-72604038
AArch64: fix calling convention for "swiftasync" parameters.
2 parents 48945ba + b6e36f4 commit 3e472be

File tree

3 files changed

+21
-1
lines changed

3 files changed

+21
-1
lines changed

llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ void TargetLoweringBase::ArgListEntry::setAttributes(const CallBase *Call,
114114
IsInAlloca = Call->paramHasAttr(ArgIdx, Attribute::InAlloca);
115115
IsReturned = Call->paramHasAttr(ArgIdx, Attribute::Returned);
116116
IsSwiftSelf = Call->paramHasAttr(ArgIdx, Attribute::SwiftSelf);
117+
IsSwiftAsync = Call->paramHasAttr(ArgIdx, Attribute::SwiftAsync);
117118
IsSwiftError = Call->paramHasAttr(ArgIdx, Attribute::SwiftError);
118119
Alignment = Call->getParamAlign(ArgIdx);
119120
ByValType = nullptr;

llvm/lib/Target/AArch64/AArch64FastISel.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2975,6 +2975,7 @@ bool AArch64FastISel::fastLowerArguments() {
29752975
Arg.hasAttribute(Attribute::InReg) ||
29762976
Arg.hasAttribute(Attribute::StructRet) ||
29772977
Arg.hasAttribute(Attribute::SwiftSelf) ||
2978+
Arg.hasAttribute(Attribute::SwiftAsync) ||
29782979
Arg.hasAttribute(Attribute::SwiftError) ||
29792980
Arg.hasAttribute(Attribute::Nest))
29802981
return false;
@@ -3233,7 +3234,7 @@ bool AArch64FastISel::fastLowerCall(CallLoweringInfo &CLI) {
32333234

32343235
for (auto Flag : CLI.OutFlags)
32353236
if (Flag.isInReg() || Flag.isSRet() || Flag.isNest() || Flag.isByVal() ||
3236-
Flag.isSwiftSelf() || Flag.isSwiftError())
3237+
Flag.isSwiftSelf() || Flag.isSwiftAsync() || Flag.isSwiftError())
32373238
return false;
32383239

32393240
// Set up the argument vectors.
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
; RUN: llc -mtriple=arm64-apple-ios %s -o - | FileCheck %s
2+
; RUN: llc -mtriple=arm64-apple-ios %s -o - -global-isel | FileCheck %s
3+
; RUN: llc -mtriple=arm64-apple-ios %s -o - -fast-isel | FileCheck %s
4+
5+
define i8* @argument(i8* swiftasync %in) {
6+
; CHECK-LABEL: argument:
7+
; CHECK: mov x0, x22
8+
9+
ret i8* %in
10+
}
11+
12+
define void @call(i8* %in) {
13+
; CHECK-LABEL: call:
14+
; CHECK: mov x22, x0
15+
16+
call i8* @argument(i8* swiftasync %in)
17+
ret void
18+
}

0 commit comments

Comments
 (0)