[PATCH] D39286: [SCEV][NFC] Introduce isDivisorOf function in SCEV

Sanjoy Das via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 25 10:49:35 PDT 2017


sanjoy requested changes to this revision.
sanjoy added inline comments.
This revision now requires changes to proceed.


================
Comment at: lib/Analysis/ScalarEvolution.cpp:8963
 
+bool ScalarEvolution::isDivisorOf(const SCEV *S, const SCEV *Divisor) {
+  assert(getEffectiveSCEVType(S->getType()) ==
----------------
This is really `isUnsignedDivisorOf`.


================
Comment at: lib/Analysis/ScalarEvolution.cpp:8973
+  // and by one.
+  if (S == Divisor || S->isZero() || Divisor->isOne())
+    return true;
----------------
If this is needed, you should add it to `getURemExpr`.


================
Comment at: lib/Analysis/ScalarEvolution.cpp:8976
+
+  // Otherwise we want to deal with positive values only. We may support
+  // negative values if we ever need them.
----------------
Why do you deal with positive values only?


https://reviews.llvm.org/D39286





More information about the llvm-commits mailing list