[PATCH] D17866: Swift Calling Convention: add swiftself attribute

Reid Kleckner via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 10 15:26:27 PST 2016


rnk added a comment.

Is this the special "context" argument that John mentioned? R10 is not a CSR on x86_64.


================
Comment at: lib/Target/AArch64/AArch64CallingConvention.td:129
@@ -128,1 +128,3 @@
 
+  // An SwiftSelf is passed in X9.
+  CCIfSwiftSelf<CCIfType<[i64], CCAssignToRegWithShadow<[X9], [W9]>>>,
----------------
"A SwitfSelf" maybe?

================
Comment at: lib/Target/ARM/ARMCallingConv.td:26
@@ -25,1 +25,3 @@
 
+  // An SwiftSelf is passed in R9.
+  CCIfSwiftSelf<CCIfType<[i32], CCAssignToReg<[R9]>>>,
----------------
ditto, and elsewhere

================
Comment at: test/CodeGen/X86/swiftself.ll:1
@@ +1,2 @@
+; RUN: llc -verify-machineinstrs < %s -mtriple=x86_64-unknown-unknown | FileCheck %s
+; RUN: llc -O0 -verify-machineinstrs < %s -mtriple=x86_64-unknown-unknown | FileCheck --check-prefix=CHECK-O0 %s
----------------
It seems you have no special rules for passing a 32-bit swiftself. That makes sense, I don't imagine you care about x86_32 swift performance. Can you add a RUN line that shows it being spilled to the stack as usual, though? I assume you'll want the ABI for it to be stable.


http://reviews.llvm.org/D17866





More information about the llvm-commits mailing list