[llvm] r313813 - X86: treat SwiftCC as Win64_CC on Win64

Saleem Abdulrasool via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 20 14:00:41 PDT 2017


Author: compnerd
Date: Wed Sep 20 14:00:40 2017
New Revision: 313813

URL: http://llvm.org/viewvc/llvm-project?rev=313813&view=rev
Log:
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.

Added:
    llvm/trunk/test/CodeGen/X86/swiftcc.ll
Modified:
    llvm/trunk/lib/Target/X86/X86Subtarget.h

Modified: llvm/trunk/lib/Target/X86/X86Subtarget.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86Subtarget.h?rev=313813&r1=313812&r2=313813&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86Subtarget.h (original)
+++ llvm/trunk/lib/Target/X86/X86Subtarget.h Wed Sep 20 14:00:40 2017
@@ -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:

Added: llvm/trunk/test/CodeGen/X86/swiftcc.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/swiftcc.ll?rev=313813&view=auto
==============================================================================
--- llvm/trunk/test/CodeGen/X86/swiftcc.ll (added)
+++ llvm/trunk/test/CodeGen/X86/swiftcc.ll Wed Sep 20 14:00:40 2017
@@ -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
+




More information about the llvm-commits mailing list