all this logic always returns true because GOT mode is never active in x86-64 mode.
authorChris Lattner <sabre@nondot.org>
Thu, 9 Jul 2009 04:27:47 +0000 (04:27 +0000)
committerChris Lattner <sabre@nondot.org>
Thu, 9 Jul 2009 04:27:47 +0000 (04:27 +0000)
Simplify it away, someone should evaluate this.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75100 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/X86/X86ISelLowering.cpp

index fc77806f56e151bc2fa5d523fff186a1f1a16f59..1deeb4560ba493374c661096da7422c07fe2f1b9 100644 (file)
@@ -2057,22 +2057,11 @@ bool X86TargetLowering::IsEligibleForTailCallOptimization(CallSDNode *TheCall,
     return false;
 
   if (CheckTailCallReturnConstraints(TheCall, Ret)) {
-    MachineFunction &MF = DAG.getMachineFunction();
-    unsigned CallerCC = MF.getFunction()->getCallingConv();
-    unsigned CalleeCC= TheCall->getCallingConv();
-    if (CalleeCC == CallingConv::Fast && CallerCC == CalleeCC) {
-      // On x86/32Bit PIC/GOT tail calls are supported.
-      if (getTargetMachine().getRelocationModel() != Reloc::PIC_ ||
-          !Subtarget->isPICStyleGOT() || !Subtarget->is64Bit())
-        return true;
-      
-      SDValue Callee = TheCall->getCallee();
-      // Can only do local tail calls (in same module, hidden or protected) on
-      // x86_64 PIC/GOT at the moment.
-      if (GlobalAddressSDNode *G = dyn_cast<GlobalAddressSDNode>(Callee))
-        return G->getGlobal()->hasHiddenVisibility()
-            || G->getGlobal()->hasProtectedVisibility();
-    }
+    unsigned CallerCC =
+      DAG.getMachineFunction().getFunction()->getCallingConv();
+    unsigned CalleeCC = TheCall->getCallingConv();
+    if (CalleeCC == CallingConv::Fast && CallerCC == CalleeCC)
+      return true;
   }
 
   return false;