Restore to pre-94570 state.
authorEvan Cheng <evan.cheng@apple.com>
Wed, 27 Jan 2010 00:00:57 +0000 (00:00 +0000)
committerEvan Cheng <evan.cheng@apple.com>
Wed, 27 Jan 2010 00:00:57 +0000 (00:00 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94625 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/X86/X86FastISel.cpp

index e3650af33bff8565c51ced7a3aa39c19316f28c1..94dec7ce355dd09c7ee88058db0b477f36108acf 100644 (file)
@@ -31,6 +31,7 @@
 #include "llvm/Support/CallSite.h"
 #include "llvm/Support/ErrorHandling.h"
 #include "llvm/Support/GetElementPtrTypeIterator.h"
+#include "llvm/Target/TargetOptions.h"
 using namespace llvm;
 
 namespace {
@@ -1243,6 +1244,11 @@ bool X86FastISel::X86SelectCall(Instruction *I) {
       CC != CallingConv::X86_FastCall)
     return false;
 
+  // fastcc with -tailcallopt is intended to provide a guaranteed
+  // tail call optimization. Fastisel doesn't know how to do that.
+  if (CC == CallingConv::Fast && PerformTailCallOpt)
+    return false;
+
   // Let SDISel handle vararg functions.
   const PointerType *PT = cast<PointerType>(CS.getCalledValue()->getType());
   const FunctionType *FTy = cast<FunctionType>(PT->getElementType());