summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/X86/X86ISelLowering.cpp
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2010-03-26 02:13:13 +0000
committerEvan Cheng <evan.cheng@apple.com>2010-03-26 02:13:13 +0000
commit00a620c61e785349ac4059d89f62707c8f0e2c2c (patch)
tree99e3140558b35007479f3b7944c7c6054fb1b823 /llvm/lib/Target/X86/X86ISelLowering.cpp
parenteb50ac5ccc65943ca0b20f469ce3a89464221542 (diff)
downloadbcm5719-llvm-00a620c61e785349ac4059d89f62707c8f0e2c2c.tar.gz
bcm5719-llvm-00a620c61e785349ac4059d89f62707c8f0e2c2c.zip
Allow trivial sibcall of vararg callee when no arguments are being passed.
llvm-svn: 99598
Diffstat (limited to 'llvm/lib/Target/X86/X86ISelLowering.cpp')
-rw-r--r--llvm/lib/Target/X86/X86ISelLowering.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/llvm/lib/Target/X86/X86ISelLowering.cpp b/llvm/lib/Target/X86/X86ISelLowering.cpp
index 75e6f505484..d08dfc4eab5 100644
--- a/llvm/lib/Target/X86/X86ISelLowering.cpp
+++ b/llvm/lib/Target/X86/X86ISelLowering.cpp
@@ -2301,8 +2301,9 @@ X86TargetLowering::IsEligibleForTailCallOptimization(SDValue Callee,
// Look for obvious safe cases to perform tail call optimization that does not
// requite ABI changes. This is what gcc calls sibcall.
- // Do not sibcall optimize vararg calls for now.
- if (isVarArg)
+ // Do not sibcall optimize vararg calls unless the call site is not passing any
+ // arguments.
+ if (isVarArg && !Outs.empty())
return false;
// Also avoid sibcall optimization if either caller or callee uses struct
OpenPOWER on IntegriCloud