diff options
author | Eric Christopher <echristo@apple.com> | 2010-03-06 10:59:25 +0000 |
---|---|---|
committer | Eric Christopher <echristo@apple.com> | 2010-03-06 10:59:25 +0000 |
commit | 1810d77cb42aa98cc298ee1d59a99d6871f8a75f (patch) | |
tree | 5e75dcdc785d4c6e3ac9110f7484a88d28493f43 /llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp | |
parent | a7fb58f5f5b24be9f3ed5eadcf10ad024b810859 (diff) | |
download | bcm5719-llvm-1810d77cb42aa98cc298ee1d59a99d6871f8a75f.tar.gz bcm5719-llvm-1810d77cb42aa98cc298ee1d59a99d6871f8a75f.zip |
Let the fallthrough handle whether or not we've changed anything
before we try to optimize.
llvm-svn: 97876
Diffstat (limited to 'llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp')
-rw-r--r-- | llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp b/llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp index e57ab58628f..e2b7d3d60db 100644 --- a/llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp +++ b/llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp @@ -948,7 +948,9 @@ Instruction *InstCombiner::visitCallSite(CallSite CS) { // 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; |