[llvm-commits] [llvm] r160422 - /llvm/trunk/lib/Transforms/Scalar/IndVarSimplify.cpp

Andrew Trick atrick at apple.com
Tue Jul 17 21:35:13 PDT 2012


Author: atrick
Date: Tue Jul 17 23:35:13 2012
New Revision: 160422

URL: http://llvm.org/viewvc/llvm-project?rev=160422&view=rev
Log:
indvars: drive by heuristics fix.

Minor oversight noticed by inspection. Sorry no unit test.

Modified:
    llvm/trunk/lib/Transforms/Scalar/IndVarSimplify.cpp

Modified: llvm/trunk/lib/Transforms/Scalar/IndVarSimplify.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/IndVarSimplify.cpp?rev=160422&r1=160421&r2=160422&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/IndVarSimplify.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/IndVarSimplify.cpp Tue Jul 17 23:35:13 2012
@@ -1409,7 +1409,7 @@
       // 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;





More information about the llvm-commits mailing list