1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-24 03:33:20 +01:00

Don't attempt to tail call optimize for Win64.

llvm-svn: 131709
This commit is contained in:
Chad Rosier 2011-05-20 00:59:28 +00:00
parent a3f5204c82
commit a5f0bb3719
2 changed files with 9 additions and 8 deletions

View File

@ -2531,17 +2531,18 @@ X86TargetLowering::IsEligibleForTailCallOptimization(SDValue Callee,
return false;
// Do not sibcall optimize vararg calls unless all arguments are passed via
// registers
// registers.
if (isVarArg && !Outs.empty()) {
// Optimizing for varargs on Win64 is unlikely to be safe without
// additional testing.
if (Subtarget->isTargetWin64())
return false;
SmallVector<CCValAssign, 16> ArgLocs;
CCState CCInfo(CalleeCC, isVarArg, getTargetMachine(),
ArgLocs, *DAG.getContext());
// Allocate shadow area for Win64
if (Subtarget->isTargetWin64()) {
CCInfo.AllocateStack(32, 8);
}
CCInfo.AnalyzeCallOperands(Outs, CC_X86);
for (unsigned i = 0, e = ArgLocs.size(); i != e; ++i)
if (!ArgLocs[i].isRegLoc())

View File

@ -12,7 +12,7 @@
; X64: @foo
; X64: jmp
; WIN64: @foo
; WIN64: jmp
; WIN64: callq
define void @foo(i64 %arg) nounwind optsize ssp noredzone {
entry:
%call = tail call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([5 x i8]* @.str, i64 0, i64 0), i64 %arg) nounwind optsize noredzone
@ -36,7 +36,7 @@ declare void @bar2(i8*, i64) optsize noredzone
; X64: @foo2
; X64: jmp
; WIN64: @foo2
; WIN64: jmp
; WIN64: callq
define i8* @foo2(i8* %arg) nounwind optsize ssp noredzone {
entry:
%tmp1 = load i8** @sel, align 8, !tbaa !0