llvm.org GIT mirror llvm / badcda4
Completely disable tail calls when fast-isel is enabled, as fast-isel doesn't currently support dealing with this. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112341 91177308-0d34-0410-b5e6-96231b3b80d8 Dan Gohman 10 years ago
2 changed file(s) with 15 addition(s) and 4 deletion(s). Raw diff Collapse all Expand all
46464646 // Target-dependent constraints are checked within TLI.LowerCallTo.
46474647 if (isTailCall &&
46484648 !isInTailCallPosition(CS, CS.getAttributes().getRetAttributes(), TLI))
4649 isTailCall = false;
4650
4651 // If there's a possibility that fast-isel has already selected some amount
4652 // of the current basic block, don't emit a tail call.
4653 if (isTailCall && EnableFastISel)
46494654 isTailCall = false;
46504655
46514656 std::pair Result =
None ; RUN: llc < %s -march=x86-64 -tailcallopt -fast-isel | grep TAILCALL
0 ; RUN: llc < %s -march=x86-64 -tailcallopt -fast-isel | not grep TAILCALL
11
2 ; Fast-isel shouldn't attempt to handle this tail call, and it should
3 ; cleanly terminate instruction selection in the block after it's
4 ; done to avoid emitting invalid MachineInstrs.
2 ; Fast-isel shouldn't attempt to cope with tail calls.
53
64 %0 = type { i64, i32, i8* }
75
108 %tmp20 = tail call fastcc i8* @"visit_array_aux<`Reference>"(%0 %arg, i32 undef) ; [#uses=1]
119 ret i8* %tmp20
1210 }
11
12 define i32 @foo() nounwind {
13 entry:
14 %0 = tail call i32 (...)* @bar() nounwind ; [#uses=1]
15 ret i32 %0
16 }
17
18 declare i32 @bar(...) nounwind