[PATCH] D104140: [SCEV] Allow negative steps for LT exit count computation

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 16 13:03:29 PDT 2021


efriedma added inline comments.


================
Comment at: llvm/lib/Analysis/ScalarEvolution.cpp:11559
   APInt One(BitWidth, 1, IsSigned);
   StrideForMaxBECount = APIntOps::smax(One, StrideForMaxBECount);
 
----------------
efriedma wrote:
> efriedma wrote:
> > Is the unconditional use of "smax" here going to cause issues?
> Oh, also, if BitWidth is one, "One" is a negative number.  `isKnownNonPositive(Stride)` guards against this, since it's always true for an i1 value. :)
I'll write a patch for computeMaxBECountForLT.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D104140/new/

https://reviews.llvm.org/D104140



More information about the llvm-commits mailing list