[PATCH] D106197: [ScalarEvolution] Refine computeMaxBECountForLT to be accurate in more cases.

Philip Reames via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 19 14:54:01 PDT 2021


reames accepted this revision.
reames added a comment.
This revision is now accepted and ready to land.

LGTM w/minor comments.



================
Comment at: llvm/lib/Analysis/ScalarEvolution.cpp:11553
+  APInt One(BitWidth, 1);
+  StrideForMaxBECount = IsSigned ? APIntOps::smax(One, StrideForMaxBECount)
+                                 : APIntOps::umax(One, StrideForMaxBECount);
----------------
This is harmless, but I believe we've already established this by the time this method is invoked.   


================
Comment at: llvm/test/Analysis/ScalarEvolution/max-trip-count.ll:459
+
+define void @max_overflow(i8 %n) mustprogress {
+; CHECK-LABEL: Determining loop execution counts for: @max_overflow
----------------
Can you add a test case for the i1 case?  I had to write it out to convince myself of your comment and I think having the test in the change would help clarify for later readers.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D106197



More information about the llvm-commits mailing list