summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/X86/X86ISelLowering.cpp
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2010-02-03 03:28:02 +0000
committerEvan Cheng <evan.cheng@apple.com>2010-02-03 03:28:02 +0000
commit40905b43024caf6781fdc20a458a5a862cc9897b (patch)
tree4bab76dc759fd55c6bffd82c848d5143d7a47acf /llvm/lib/Target/X86/X86ISelLowering.cpp
parentc434394d183a00235f8773de831b447d35e1963c (diff)
downloadbcm5719-llvm-40905b43024caf6781fdc20a458a5a862cc9897b.tar.gz
bcm5719-llvm-40905b43024caf6781fdc20a458a5a862cc9897b.zip
Allow all types of callee's to be tail called. But avoid automatic tailcall if the callee is a result of bitcast to avoid losing necessary zext / sext etc.
llvm-svn: 95195
Diffstat (limited to 'llvm/lib/Target/X86/X86ISelLowering.cpp')
-rw-r--r--llvm/lib/Target/X86/X86ISelLowering.cpp18
1 files changed, 1 insertions, 17 deletions
diff --git a/llvm/lib/Target/X86/X86ISelLowering.cpp b/llvm/lib/Target/X86/X86ISelLowering.cpp
index 6f710ecbe15..9d6b5a39b2a 100644
--- a/llvm/lib/Target/X86/X86ISelLowering.cpp
+++ b/llvm/lib/Target/X86/X86ISelLowering.cpp
@@ -2269,7 +2269,6 @@ X86TargetLowering::IsEligibleForTailCallOptimization(SDValue Callee,
return false;
}
-
// Look for obvious safe cases to perform tail call optimization that does not
// requite ABI changes. This is what gcc calls sibcall.
@@ -2324,22 +2323,7 @@ X86TargetLowering::IsEligibleForTailCallOptimization(SDValue Callee,
}
}
- // If the caller does not return a value, then this is obviously safe.
- // This is one case where it's safe to perform this optimization even
- // if the return types do not match.
- const Type *CallerRetTy = CallerF->getReturnType();
- if (CallerRetTy->isVoidTy())
- 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?
- if (const Function *CalleeF = dyn_cast<Function>(G->getGlobal())) {
- const Type *CalleeRetTy = CalleeF->getReturnType();
- return CallerRetTy == CalleeRetTy;
- }
- return false;
+ return true;
}
FastISel *
OpenPOWER on IntegriCloud