[PATCH] D39954: [IRCE] Smart range intersection

Max Kazantsev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 14 19:23:21 PST 2017


mkazantsev added inline comments.


================
Comment at: lib/Transforms/Scalar/InductiveRangeCheckElimination.cpp:1697
   }
-
-  const SCEV *End = SE.getMinusSCEV(UpperLimit, M);
+  const SCEV *End = Substract(UpperLimit, M);
   return InductiveRangeCheck::Range(Begin, End);
----------------
anna wrote:
> is UpperLimit guaranteed to be in [0, SINT_MAX] ? 
We fail the assertion on line 1656 if it is not. It ` getEnd()` exists, it is ensured by `IsNonNegativeAndNotLoopVarying` invocation in `parseRangeCheckICmp`. Otherwise `SINT_MAX` is non-negative.


https://reviews.llvm.org/D39954





More information about the llvm-commits mailing list