[PATCH] D48338: [SCEV] Improve zext(A /u B) and zext(A % B)

Sanjoy Das via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 20 18:38:55 PDT 2018


sanjoy accepted this revision.
sanjoy added inline comments.
This revision is now accepted and ready to land.


================
Comment at: llvm/lib/Analysis/ScalarEvolution.cpp:12178
+  const auto *Add = dyn_cast<SCEVAddExpr>(Expr);
+  if (Add == nullptr || Add->getNumOperands() != 2) return false;
+
----------------
LLVM style is putting the `return false;` on a different line (though you'll probably find violations in this source file).

The checked in `.clang-format` should DTRT though.


================
Comment at: llvm/lib/Analysis/ScalarEvolution.cpp:12185
+
+  const auto MatchURem = [&](const SCEV *B) {
+    // (SomeExpr + (-(SomeExpr / B) * B)).
----------------
Might be clearer to call this `MatchURemWithDivisor` and call the argument `Divisor` or `D`.


https://reviews.llvm.org/D48338





More information about the llvm-commits mailing list