[llvm] r279853 - Swift Calling Convetion: add support for AArch64.
Manman Ren via llvm-commits
llvm-commits at lists.llvm.org
Fri Aug 26 12:28:18 PDT 2016
Author: mren
Date: Fri Aug 26 14:28:17 2016
New Revision: 279853
URL: http://llvm.org/viewvc/llvm-project?rev=279853&view=rev
Log:
Swift Calling Convetion: add support for AArch64.
It will just be the same as the regular calling convention.
rdar://28029509
Added:
llvm/trunk/test/CodeGen/AArch64/swiftcc.ll
Modified:
llvm/trunk/lib/Target/AArch64/AArch64FastISel.cpp
llvm/trunk/lib/Target/AArch64/AArch64ISelLowering.cpp
Modified: llvm/trunk/lib/Target/AArch64/AArch64FastISel.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AArch64/AArch64FastISel.cpp?rev=279853&r1=279852&r2=279853&view=diff
==============================================================================
--- llvm/trunk/lib/Target/AArch64/AArch64FastISel.cpp (original)
+++ llvm/trunk/lib/Target/AArch64/AArch64FastISel.cpp Fri Aug 26 14:28:17 2016
@@ -2860,7 +2860,7 @@ bool AArch64FastISel::fastLowerArguments
return false;
CallingConv::ID CC = F->getCallingConv();
- if (CC != CallingConv::C)
+ if (CC != CallingConv::C && CC != CallingConv::Swift)
return false;
// Only handle simple cases of up to 8 GPR and FPR each.
Modified: llvm/trunk/lib/Target/AArch64/AArch64ISelLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AArch64/AArch64ISelLowering.cpp?rev=279853&r1=279852&r2=279853&view=diff
==============================================================================
--- llvm/trunk/lib/Target/AArch64/AArch64ISelLowering.cpp (original)
+++ llvm/trunk/lib/Target/AArch64/AArch64ISelLowering.cpp Fri Aug 26 14:28:17 2016
@@ -2429,6 +2429,7 @@ CCAssignFn *AArch64TargetLowering::CCAss
case CallingConv::Fast:
case CallingConv::PreserveMost:
case CallingConv::CXX_FAST_TLS:
+ case CallingConv::Swift:
if (!Subtarget->isTargetDarwin())
return CC_AArch64_AAPCS;
return IsVarArg ? CC_AArch64_DarwinPCS_VarArg : CC_AArch64_DarwinPCS;
Added: llvm/trunk/test/CodeGen/AArch64/swiftcc.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/AArch64/swiftcc.ll?rev=279853&view=auto
==============================================================================
--- llvm/trunk/test/CodeGen/AArch64/swiftcc.ll (added)
+++ llvm/trunk/test/CodeGen/AArch64/swiftcc.ll Fri Aug 26 14:28:17 2016
@@ -0,0 +1,11 @@
+; RUN: llc -verify-machineinstrs -mtriple=aarch64-apple-ios -o - %s | FileCheck %s
+; RUN: llc -O0 -verify-machineinstrs -mtriple=aarch64-apple-ios -o - %s | FileCheck %s
+
+; CHECK: t1
+; CHECK: fadd s0, s0, s1
+; CHECK: ret
+define swiftcc float @t1(float %a, float %b) {
+entry:
+ %add = fadd float %a, %b
+ ret float %add
+}
More information about the llvm-commits
mailing list