[PATCH] D145510: [SCEV] Fix finite loop non-strict predicate simplification (PR60944)

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 12 12:00:35 PDT 2023


efriedma added a comment.

The original C code is something like `for (unsigned i = 0; i <= m; i++)`. The reduction just cut out the loop body.

At a high level, determining that the "max" is unnecessary shouldn't be hard; the only reason it's tricky is that `howManyLessThans` doesn't know that "m+1" doesn't overflow.  If we had a dedicated `howManyLessThanOrEquals`, we would do the right thing without any special logic.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D145510



More information about the llvm-commits mailing list