summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2010-03-26 16:26:03 +0000
committerEvan Cheng <evan.cheng@apple.com>2010-03-26 16:26:03 +0000
commit3365fb14122ef246a51a868f0d6e22014eae2ef9 (patch)
tree4ee134db3ca32b4916472e310d28c13af16d73ac /llvm/lib/Target
parent7da63a36f1be5c40c49f5bac3115ee9ceae66fc4 (diff)
downloadbcm5719-llvm-3365fb14122ef246a51a868f0d6e22014eae2ef9.tar.gz
bcm5719-llvm-3365fb14122ef246a51a868f0d6e22014eae2ef9.zip
Do not sibcall if stack needs to be dynamically aligned.
llvm-svn: 99620
Diffstat (limited to 'llvm/lib/Target')
-rw-r--r--llvm/lib/Target/X86/X86ISelLowering.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/llvm/lib/Target/X86/X86ISelLowering.cpp b/llvm/lib/Target/X86/X86ISelLowering.cpp
index d08dfc4eab5..707b9fe2c59 100644
--- a/llvm/lib/Target/X86/X86ISelLowering.cpp
+++ b/llvm/lib/Target/X86/X86ISelLowering.cpp
@@ -2290,6 +2290,7 @@ X86TargetLowering::IsEligibleForTailCallOptimization(SDValue Callee,
return false;
// If -tailcallopt is specified, make fastcc functions tail-callable.
+ const MachineFunction &MF = DAG.getMachineFunction();
const Function *CallerF = DAG.getMachineFunction().getFunction();
if (GuaranteedTailCallOpt) {
if (IsTailCallConvention(CalleeCC) &&
@@ -2301,6 +2302,11 @@ 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.
+ // Can't do sibcall if stack needs to be dynamically re-aligned. PEI needs to
+ // emit a special epilogue.
+ if (RegInfo->needsStackRealignment(MF))
+ return false;
+
// Do not sibcall optimize vararg calls unless the call site is not passing any
// arguments.
if (isVarArg && !Outs.empty())
OpenPOWER on IntegriCloud