mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2024-12-15 20:12:50 +00:00
[X86] Enable tail calls for CallingConv::Swift
It's currently only enabled on AArch64 (enabled in r281376). llvm-svn: 357809
This commit is contained in:
parent
ab051a378c
commit
9d9d1b6b2b
@ -2941,6 +2941,8 @@ static bool mayTailCallThisCC(CallingConv::ID CC) {
|
||||
case CallingConv::X86_StdCall:
|
||||
case CallingConv::X86_VectorCall:
|
||||
case CallingConv::X86_FastCall:
|
||||
// Swift:
|
||||
case CallingConv::Swift:
|
||||
return true;
|
||||
default:
|
||||
return canGuaranteeTCO(CC);
|
||||
|
@ -1,11 +1,21 @@
|
||||
; RUN: llc -mtriple x86_64-unknown-windows-msvc -filetype asm -o - %s | FileCheck %s
|
||||
; RUN: llc -mtriple x86_64-- -filetype asm -o - %s | FileCheck %s
|
||||
; RUN: llc -mtriple x86_64-unknown-windows-msvc -filetype asm -o - %s | FileCheck %s --check-prefix=MSVC
|
||||
|
||||
define swiftcc void @f() {
|
||||
%1 = alloca i8
|
||||
ret void
|
||||
}
|
||||
|
||||
; CHECK-LABEL: f
|
||||
; CHECK: .seh_stackalloc 8
|
||||
; CHECK: .seh_endprologue
|
||||
; MSVC-LABEL: f
|
||||
; MSVC: .seh_stackalloc 8
|
||||
; MSVC: .seh_endprologue
|
||||
|
||||
declare swiftcc i64 @myFunc()
|
||||
define swiftcc i64 @myFunc2() nounwind {
|
||||
%r = tail call swiftcc i64 @myFunc()
|
||||
ret i64 %r
|
||||
}
|
||||
|
||||
; CHECK-LABEL: myFunc2
|
||||
; CHECK: jmp myFunc
|
||||
; CHECK-NOT: call
|
||||
|
Loading…
Reference in New Issue
Block a user