mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-22 18:54:02 +01:00
fc5daa6083
Swift's new concurrency features are going to require guaranteed tail calls so that they don't consume excessive amounts of stack space. This would normally mean "tailcc", but there are also Swift-specific ABI desires that don't naturally go along with "tailcc" so this adds another calling convention that's the combination of "swiftcc" and "tailcc". Support is added for AArch64 and X86 for now.
19 lines
446 B
LLVM
19 lines
446 B
LLVM
; RUN: llc -mtriple=arm64-apple-ios %s -o - | FileCheck %s
|
|
|
|
|
|
declare swifttailcc void @swifttail_callee()
|
|
define swifttailcc void @swifttail() {
|
|
; CHECK-LABEL: swifttail:
|
|
; CHECK-NOT: ld{{.*}}x22
|
|
call void asm "","~{x22}"()
|
|
tail call swifttailcc void @swifttail_callee()
|
|
ret void
|
|
}
|
|
|
|
define swifttailcc void @no_preserve_swiftself() {
|
|
; CHECK-LABEL: no_preserve_swiftself:
|
|
; CHECK-NOT: ld{{.*}}x20
|
|
call void asm "","~{x20}"()
|
|
ret void
|
|
}
|