X86: adjust the windows 64 calling convention for Swift
authorSaleem Abdulrasool <compnerd@compnerd.org>
Sun, 14 Mar 2021 00:50:23 +0000 (16:50 -0800)
committerSaleem Abdulrasool <compnerd@compnerd.org>
Sun, 14 Mar 2021 00:53:20 +0000 (16:53 -0800)
commitc9fce5f0c3a82cf037c288e840d857066aab75af
tree2ede5de9fbaa5826911a3dee9a3f25d072dbbbca
parent7c0179129fa93afa6bd893c51314820f05355b87
X86: adjust the windows 64 calling convention for Swift

Adjust the Win64 calling convention for Swift to pass self in R13, which
is traditionally a CSR.  This makes the behaviour similar to the SysV CC
for Swift as well.  This should improve the argument passing on Windows,
although it comes at a high cost of ABI incompatibility.  Fortunately in
this case, there is no guarantee of ABI stability, and so we can make
this incompatible change.
llvm/lib/Target/X86/X86CallingConv.td
llvm/test/CodeGen/X86/swiftself-win64.ll [new file with mode: 0644]