From: Andrew Trick Date: Wed, 18 Jul 2012 04:35:13 +0000 (+0000) Subject: indvars: drive by heuristics fix. X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=7f496a628eb93d60eed39340fcc5e89479eda488;p=oota-llvm.git indvars: drive by heuristics fix. Minor oversight noticed by inspection. Sorry no unit test. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160422 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Transforms/Scalar/IndVarSimplify.cpp b/lib/Transforms/Scalar/IndVarSimplify.cpp index 4b5c84ca6ce..37f8bdfbffe 100644 --- a/lib/Transforms/Scalar/IndVarSimplify.cpp +++ b/lib/Transforms/Scalar/IndVarSimplify.cpp @@ -1409,7 +1409,7 @@ FindLoopCounter(Loop *L, const SCEV *BECount, // If two IVs both count from zero or both count from nonzero then the // narrower is likely a dead phi that has been widened. Use the wider phi // to allow the other to be eliminated. - if (PhiWidth <= SE->getTypeSizeInBits(BestPhi->getType())) + else if (PhiWidth <= SE->getTypeSizeInBits(BestPhi->getType())) continue; } BestPhi = Phi;