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

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 25 12:41:26 PDT 2018


efriedma added subscribers: mkazantsev, mzolotukhin.
efriedma added inline comments.


================
Comment at: lib/Analysis/ScalarEvolution.cpp:8715
+    Optional<APInt> Min = MinOptional(SO, UO);
+    if (Min.hasValue() && LeavesRange(*Min))
+      return { Min, true };
----------------
Min.hasValue() is always true here.


================
Comment at: lib/Analysis/ScalarEvolution.cpp:8719
+    if (Max.hasValue() && LeavesRange(*Max))
+      return { Max, true };
+
----------------
How do you ensure the correct solution isn't some value between Min and Max?

Similarly, in the case where SolveForBoundary returns None, how can you be sure the correct solution isn't some value between the Max for this boundary and the Min of the other boundary?


Repository:
  rL LLVM

https://reviews.llvm.org/D48283





More information about the llvm-commits mailing list