[PATCH] D62990: [SCEV][WIP] Try fix PR42175

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 7 12:39:06 PDT 2019


efriedma added inline comments.


================
Comment at: lib/Analysis/ScalarEvolution.cpp:10451
+          getMinusSCEV(Start, Stride), End))
+    MinStart += getUnsignedRangeMin(Stride);
+
----------------
If I'm following correctly, this is sort of similar to what we do in ScalarEvolution::howFarToZero: If `Start - Stride` doesn't overflow, instead of querying `unsigned_min(Start)` directly, we can use `unsigned_min(Start - Stride) + Stride` instead.

It looks like this is actually computing `unsigned_min(Start) + Stride`, though, which I don't think is correct.

It's not obvious to me that the case where Stride is not a constant (so it's actually `unsigned_min(Start - Stride) + unsigned_min(Stride)`) works the same way as the case where Stride is a constant, although it seems plausible.


Repository:
  rL LLVM

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

https://reviews.llvm.org/D62990





More information about the llvm-commits mailing list