[llvm] r365067 - [LFTR] Remove falsely generalized (dead) code [NFC]

Philip Reames via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 3 11:24:06 PDT 2019


Author: reames
Date: Wed Jul  3 11:24:06 2019
New Revision: 365067

URL: http://llvm.org/viewvc/llvm-project?rev=365067&view=rev
Log:
[LFTR] Remove falsely generalized (dead) code [NFC]


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=365067&r1=365066&r2=365067&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/IndVarSimplify.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/IndVarSimplify.cpp Wed Jul  3 11:24:06 2019
@@ -2477,11 +2477,8 @@ linearFunctionTestReplace(Loop *L, Basic
       Count = Count.zext(CmpIndVarSize);
       if (UsePostInc)
         ++Count;
-      APInt NewLimit;
-      if (cast<SCEVConstant>(ARStep)->getValue()->isNegative())
-        NewLimit = Start - Count;
-      else
-        NewLimit = Start + Count;
+      assert(cast<SCEVConstant>(ARStep)->getValue()->isOne());
+      APInt NewLimit = Start + Count;
       ExitCnt = ConstantInt::get(CmpIndVar->getType(), NewLimit);
     } else {
       // We try to extend trip count first. If that doesn't work we truncate IV.




More information about the llvm-commits mailing list