[PATCH] D48283: [SCEV] Properly solve quadratic equations

Krzysztof Parzyszek via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 19 08:02:59 PDT 2018


kparzysz added a comment.

In https://reviews.llvm.org/D48283#1167248, @efriedma wrote:

> The current getNumIterationsInRange implementation is consistent with "equals 0 or wraps around 2^BW in the unsigned modulo 2^BW arithmetic" (but that's not what SolveQuadraticEquation actually computes at the moment).


Generic comments like this are not very helpful.  Please be more specific in explaining your concerns.

The addrec in your example is `{x,+,-1,+,-1}`, where `x` is some starting value. In unsigned arithmetic this expression has an unsigned overflow right at the first iteration (regardless of `x`), but it doesn't mean that it goes out of the range in the first step.


Repository:
  rL LLVM

https://reviews.llvm.org/D48283





More information about the llvm-commits mailing list