diff options
| author | Evan Cheng <evan.cheng@apple.com> | 2010-02-01 02:13:39 +0000 |
|---|---|---|
| committer | Evan Cheng <evan.cheng@apple.com> | 2010-02-01 02:13:39 +0000 |
| commit | ed8ca56eeb21bae23e832c05905d3a2ce5016e6f (patch) | |
| tree | 59086456c16f2605693c7fb20af46026a3f6f712 /llvm/lib/Target/X86/X86ISelLowering.cpp | |
| parent | 1cb8b33d61c255e49a5f95c34abd407f39d37dd8 (diff) | |
| download | bcm5719-llvm-ed8ca56eeb21bae23e832c05905d3a2ce5016e6f.tar.gz bcm5719-llvm-ed8ca56eeb21bae23e832c05905d3a2ce5016e6f.zip | |
Undo r94946 now all the tests are passing again.
llvm-svn: 94970
Diffstat (limited to 'llvm/lib/Target/X86/X86ISelLowering.cpp')
| -rw-r--r-- | llvm/lib/Target/X86/X86ISelLowering.cpp | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/llvm/lib/Target/X86/X86ISelLowering.cpp b/llvm/lib/Target/X86/X86ISelLowering.cpp index e272d9b92af..5b7629852ee 100644 --- a/llvm/lib/Target/X86/X86ISelLowering.cpp +++ b/llvm/lib/Target/X86/X86ISelLowering.cpp @@ -2263,17 +2263,6 @@ X86TargetLowering::IsEligibleForTailCallOptimization(SDValue Callee, if (isVarArg) return false; - // Don't tail call optimize recursive call. - GlobalAddressSDNode *G = dyn_cast<GlobalAddressSDNode>(Callee); - const Function *CalleeF = G ? cast<Function>(G->getGlobal()) : 0; - if (CallerF == CalleeF) - return false; - // If it's an indirect call, conversatively return false if the caller's - // address is taken. - if (!CalleeF && - !isa<ExternalSymbolSDNode>(Callee) && CallerF->hasAddressTaken()) - return false; - // Look for obvious safe cases to perform tail call optimization. // If the callee takes no arguments then go on to check the results of the // call. @@ -2296,7 +2285,10 @@ X86TargetLowering::IsEligibleForTailCallOptimization(SDValue Callee, return true; // If the return types match, then it's safe. + // Don't tail call optimize recursive call. + GlobalAddressSDNode *G = dyn_cast<GlobalAddressSDNode>(Callee); if (!G) return false; // FIXME: common external symbols? + const Function *CalleeF = cast<Function>(G->getGlobal()); const Type *CalleeRetTy = CalleeF->getReturnType(); return CallerRetTy == CalleeRetTy; } |

