llvm.org GIT mirror llvm / 1f2fda9
Re-enable x86 tail call optimization. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95295 91177308-0d34-0410-b5e6-96231b3b80d8 Evan Cheng 10 years ago
2 changed file(s) with 2 addition(s) and 6 deletion(s). Raw diff Collapse all Expand all
5151
5252 STATISTIC(NumTailCalls, "Number of tail calls");
5353
54 static cl::opt TailCallLimit("tailcall-limit", cl::init(0));
5554 static cl::opt
5655 DisableMMX("disable-mmx", cl::Hidden, cl::desc("Disable use of MMX"));
5756
22702269
22712270 // Look for obvious safe cases to perform tail call optimization that does not
22722271 // requite ABI changes. This is what gcc calls sibcall.
2273 if (NumTailCalls >= TailCallLimit)
2274 return false;
22752272
22762273 // Do not tail call optimize vararg calls for now.
22772274 if (isVarArg)
0 ; RUN: llc < %s -march=x86 -asm-verbose=false | FileCheck %s -check-prefix=32
11 ; RUN: llc < %s -march=x86-64 -asm-verbose=false | FileCheck %s -check-prefix=64
2 ; XFAIL: *
32
43 define void @t1(i32 %x) nounwind ssp {
54 entry:
106105 define signext i16 @t8() nounwind ssp {
107106 entry:
108107 ; 32: t8:
109 ; 32: jmp {{_?}}bar3
108 ; 32: call {{_?}}bar3
110109
111110 ; 64: t8:
112 ; 64: jmp {{_?}}bar3
111 ; 64: callq {{_?}}bar3
113112 %0 = tail call signext i16 @bar3() nounwind ; [#uses=1]
114113 ret i16 %0
115114 }