[PATCH] D90395: [SCEV] Generalize monotonicity check for full and limited iteration space

Artur Pilipenko via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 10 19:15:07 PST 2020


apilipenko added inline comments.


================
Comment at: llvm/lib/Analysis/ScalarEvolution.cpp:9291-9325
+  bool ProvedNoWrap =
+      IsUnsigned ? LHS->hasNoUnsignedWrap() : LHS->hasNoSignedWrap();
+  const SCEV *Step = LHS->getStepRecurrence(*this);
+  bool IsStepNonNegative = isKnownNonNegative(Step);
+  bool IsStepNonPositive = isKnownNonPositive(Step);
+
+  // If we only care about first several iterations, check that start <= end for
----------------
Maybe move ProvedNoWrap into a lambda? This way the checks can be turned into early exits which should make it easier to follow the logic.


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

https://reviews.llvm.org/D90395



More information about the llvm-commits mailing list