Fix a case where tailcallelim wouldn't set the changed bit when it made a change.
authorChris Lattner <sabre@nondot.org>
Sat, 14 Jun 2008 00:49:48 +0000 (00:49 +0000)
committerChris Lattner <sabre@nondot.org>
Sat, 14 Jun 2008 00:49:48 +0000 (00:49 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52267 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/Scalar/TailRecursionElimination.cpp

index 61222f8732fa68053ca09259882e82c00b005e37..6fcf55b581aa01312bf35cd875d550234fb0cc07 100644 (file)
@@ -185,8 +185,10 @@ bool TailCallElim::runOnFunction(Function &F) {
   if (!FunctionContainsEscapingAllocas)
     for (Function::iterator BB = F.begin(), E = F.end(); BB != E; ++BB)
       for (BasicBlock::iterator I = BB->begin(), E = BB->end(); I != E; ++I)
-        if (CallInst *CI = dyn_cast<CallInst>(I))
+        if (CallInst *CI = dyn_cast<CallInst>(I)) {
           CI->setTailCall();
+          MadeChange = true;
+        }
 
   return MadeChange;
 }