Speculatively disable x86 automatic tail call optimization while we track down a self-hosting issue.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95259 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Target/X86/X86ISelLowering.cpp b/lib/Target/X86/X86ISelLowering.cpp
index 9d6b5a3..2b5ff3c 100644
--- a/lib/Target/X86/X86ISelLowering.cpp
+++ b/lib/Target/X86/X86ISelLowering.cpp
@@ -52,6 +52,7 @@
 
 STATISTIC(NumTailCalls, "Number of tail calls");
 
+static cl::opt<unsigned> TailCallLimit("tailcall-limit", cl::init(0));
 static cl::opt<bool>
 DisableMMX("disable-mmx", cl::Hidden, cl::desc("Disable use of MMX"));
 
@@ -2271,6 +2272,8 @@
 
   // Look for obvious safe cases to perform tail call optimization that does not
   // requite ABI changes. This is what gcc calls sibcall.
+  if (NumTailCalls >= TailCallLimit)
+    return false;
 
   // Do not tail call optimize vararg calls for now.
   if (isVarArg)