summaryrefslogtreecommitdiffstats
path: root/llvm
diff options
context:
space:
mode:
authorSaleem Abdulrasool <compnerd@compnerd.org>2017-09-20 21:00:40 +0000
committerSaleem Abdulrasool <compnerd@compnerd.org>2017-09-20 21:00:40 +0000
commitaff96d907b562fb2a9b0934553dadb21b58f261c (patch)
tree0da7ddfe86ea9a03a23545c5aff7c66e7c27c750 /llvm
parente135c4c6a6a495a8d5ea260c69ae2ed1666e5bfe (diff)
downloadbcm5719-llvm-aff96d907b562fb2a9b0934553dadb21b58f261c.tar.gz
bcm5719-llvm-aff96d907b562fb2a9b0934553dadb21b58f261c.zip
X86: treat SwiftCC as Win64_CC on Win64
The Swift CC is identical to Win64 CC with the exception of swift error being passed in r12 which is a CSR. However, since this calling convention is only used in swift -> swift code, it does not impact interoperability and can be treated entirely as Win64 CC. We would previously incorrectly lower the frame setup as we did not treat the frame as conforming to Win64 specifications. llvm-svn: 313813
Diffstat (limited to 'llvm')
-rw-r--r--llvm/lib/Target/X86/X86Subtarget.h1
-rw-r--r--llvm/test/CodeGen/X86/swiftcc.ll11
2 files changed, 12 insertions, 0 deletions
diff --git a/llvm/lib/Target/X86/X86Subtarget.h b/llvm/lib/Target/X86/X86Subtarget.h
index 61fa9252770..a8de6eaf1cc 100644
--- a/llvm/lib/Target/X86/X86Subtarget.h
+++ b/llvm/lib/Target/X86/X86Subtarget.h
@@ -614,6 +614,7 @@ public:
// On Win64, all these conventions just use the default convention.
case CallingConv::C:
case CallingConv::Fast:
+ case CallingConv::Swift:
case CallingConv::X86_FastCall:
case CallingConv::X86_StdCall:
case CallingConv::X86_ThisCall:
diff --git a/llvm/test/CodeGen/X86/swiftcc.ll b/llvm/test/CodeGen/X86/swiftcc.ll
new file mode 100644
index 00000000000..dc36ee247f1
--- /dev/null
+++ b/llvm/test/CodeGen/X86/swiftcc.ll
@@ -0,0 +1,11 @@
+; RUN: llc -mtriple x86_64-unknown-windows-msvc -filetype asm -o - %s | FileCheck %s
+
+define swiftcc void @f() {
+ %1 = alloca i8
+ ret void
+}
+
+; CHECK-LABEL: f
+; CHECK: .seh_stackalloc 8
+; CHECK: .seh_endprologue
+
OpenPOWER on IntegriCloud