[llvm-commits] [llvm] r131709 - in /llvm/trunk: lib/Target/X86/X86ISelLowering.cpp test/CodeGen/X86/vararg_tailcall.ll
Chad Rosier
mcrosier at apple.com
Thu May 19 17:59:28 PDT 2011
Author: mcrosier
Date: Thu May 19 19:59:28 2011
New Revision: 131709
URL: http://llvm.org/viewvc/llvm-project?rev=131709&view=rev
Log:
Don't attempt to tail call optimize for Win64.
Modified:
llvm/trunk/lib/Target/X86/X86ISelLowering.cpp
llvm/trunk/test/CodeGen/X86/vararg_tailcall.ll
Modified: llvm/trunk/lib/Target/X86/X86ISelLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ISelLowering.cpp?rev=131709&r1=131708&r2=131709&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86ISelLowering.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86ISelLowering.cpp Thu May 19 19:59:28 2011
@@ -2531,17 +2531,18 @@
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())
Modified: llvm/trunk/test/CodeGen/X86/vararg_tailcall.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/vararg_tailcall.ll?rev=131709&r1=131708&r2=131709&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/X86/vararg_tailcall.ll (original)
+++ llvm/trunk/test/CodeGen/X86/vararg_tailcall.ll Thu May 19 19:59:28 2011
@@ -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 @@
; 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
More information about the llvm-commits
mailing list