[llvm-commits] [llvm] r97876 - /llvm/trunk/lib/Transforms/InstCombine/InstCombineCalls.cpp

Eric Christopher echristo at apple.com
Sat Mar 6 02:59:25 PST 2010


Author: echristo
Date: Sat Mar  6 04:59:25 2010
New Revision: 97876

URL: http://llvm.org/viewvc/llvm-project?rev=97876&view=rev
Log:
Let the fallthrough handle whether or not we've changed anything
before we try to optimize.

Modified:
    llvm/trunk/lib/Transforms/InstCombine/InstCombineCalls.cpp

Modified: llvm/trunk/lib/Transforms/InstCombine/InstCombineCalls.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/InstCombine/InstCombineCalls.cpp?rev=97876&r1=97875&r2=97876&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/InstCombine/InstCombineCalls.cpp (original)
+++ llvm/trunk/lib/Transforms/InstCombine/InstCombineCalls.cpp Sat Mar  6 04:59:25 2010
@@ -948,7 +948,9 @@
   // delete the instruction now.
   if (CallInst *CI = dyn_cast<CallInst>(CS.getInstruction())) {
     Instruction *I = tryOptimizeCall(CI, TD);
-    return I ? EraseInstFromFunction(*I): 0;
+    // If we changed something return the result, etc. Otherwise let
+    // the fallthrough check.
+    if (I) return EraseInstFromFunction(*I);
   }
 
   return Changed ? CS.getInstruction() : 0;





More information about the llvm-commits mailing list