summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/X86
diff options
context:
space:
mode:
authorManman Ren <manman.ren@gmail.com>2016-03-18 23:41:51 +0000
committerManman Ren <manman.ren@gmail.com>2016-03-18 23:41:51 +0000
commit4865d89653f36cc16daffdbdec37629b88bb2d54 (patch)
tree32e140c2d6b619ee06a420be39a4588f5854bf8a /llvm/lib/Target/X86
parent2828c57b6f40a6d8a42ea6b72aedf39e58325764 (diff)
downloadbcm5719-llvm-4865d89653f36cc16daffdbdec37629b88bb2d54.tar.gz
bcm5719-llvm-4865d89653f36cc16daffdbdec37629b88bb2d54.zip
[CXX_FAST_TLS] Disable tail call when calling conventions are mismatched.
Since CXX_FAST_TLS has a bigger set of CSRs, we don't tail call when caller and callee have mismatched calling conventions. llvm-svn: 263856
Diffstat (limited to 'llvm/lib/Target/X86')
-rw-r--r--llvm/lib/Target/X86/X86ISelLowering.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/llvm/lib/Target/X86/X86ISelLowering.cpp b/llvm/lib/Target/X86/X86ISelLowering.cpp
index e0e46d912b5..a5af0fcf62f 100644
--- a/llvm/lib/Target/X86/X86ISelLowering.cpp
+++ b/llvm/lib/Target/X86/X86ISelLowering.cpp
@@ -3767,6 +3767,13 @@ bool X86TargetLowering::IsEligibleForTailCallOptimization(
if (IsCalleeWin64 != IsCallerWin64)
return false;
+ // Disable tailcall for CXX_FAST_TLS when callee and caller have different
+ // calling conventions, given that CXX_FAST_TLS has a bigger CSR set.
+ if (!CCMatch &&
+ (CallerCC == CallingConv::CXX_FAST_TLS ||
+ CalleeCC == CallingConv::CXX_FAST_TLS))
+ return false;
+
if (DAG.getTarget().Options.GuaranteedTailCallOpt) {
if (canGuaranteeTCO(CalleeCC) && CCMatch)
return true;
OpenPOWER on IntegriCloud