[PATCH] D44515: [IRCE] Change min value safety check

Max Kazantsev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 19 22:39:05 PDT 2018


mkazantsev added inline comments.


================
Comment at: lib/Transforms/Scalar/InductiveRangeCheckElimination.cpp:697
+  const SCEV *Limit = SE.getMinusSCEV(Max, StepMinusOne);
+  auto Predicate = Signed ? ICmpInst::ICMP_SGT : ICmpInst::ICMP_UGT;
+  return SE.isLoopBackedgeGuardedByCond(L, Predicate, BoundSCEV, Limit);
----------------
mkazantsev wrote:
> This is incorrect. You need to prove that `BoundSCEV < Limit`, so you should use SLT/ULT predicates, not SGT/ULT.
SLT/ULT predicates, not SGT/UGT**


https://reviews.llvm.org/D44515





More information about the llvm-commits mailing list