Disable most IR-level transform passes on functions marked 'optnone'.
[oota-llvm.git] / lib / Transforms / Scalar / TailRecursionElimination.cpp
index 9fb8ddc3d2c1c15475efd0cb73cb66e36c70c8cf..351aee058ba846fa69740d18d871d5b54d53a428 100644 (file)
@@ -171,6 +171,9 @@ struct AllocaCaptureTracker : public CaptureTracker {
 } // end anonymous namespace
 
 bool TailCallElim::runOnFunction(Function &F) {
+  if (skipOptnoneFunction(F))
+    return false;
+
   // If this function is a varargs function, we won't be able to PHI the args
   // right, so don't even try to convert it...
   if (F.getFunctionType()->isVarArg()) return false;