From: Eric Christopher Date: Sat, 6 Mar 2010 10:59:25 +0000 (+0000) Subject: Let the fallthrough handle whether or not we've changed anything X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=7b323a34fa034389e9e439f6c02eeb73e87ab9db;p=oota-llvm.git Let the fallthrough handle whether or not we've changed anything before we try to optimize. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97876 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Transforms/InstCombine/InstCombineCalls.cpp b/lib/Transforms/InstCombine/InstCombineCalls.cpp index e57ab58628f..e2b7d3d60db 100644 --- a/lib/Transforms/InstCombine/InstCombineCalls.cpp +++ b/lib/Transforms/InstCombine/InstCombineCalls.cpp @@ -948,7 +948,9 @@ Instruction *InstCombiner::visitCallSite(CallSite CS) { // delete the instruction now. if (CallInst *CI = dyn_cast(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;