[PATCH] D39954: [IRCE] Smart range intersection

Anna Thomas via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 14 11:15:08 PST 2017


anna added inline comments.


================
Comment at: lib/Transforms/Scalar/InductiveRangeCheckElimination.cpp:1624
   //
   //   0 <= M + 1 * IndVar < L given L >= 0  (i.e. N == 1)
   //
----------------
Could you please state here what exactly L stands for?


================
Comment at: lib/Transforms/Scalar/InductiveRangeCheckElimination.cpp:1665
+      // If 0 <= -Y <= (SINT_MAX - X), we substract Y safely.
+      //   Rule 2: Y >=s (X - SINT_MA) ---> Y.
+      // If 0 <= (SINT_MAX - X) < -Y, we can only substract (X - SINT).
----------------
SINT_MAX


================
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);
----------------
is UpperLimit guaranteed to be in [0, SINT_MAX] ? 


https://reviews.llvm.org/D39954





More information about the llvm-commits mailing list