[PATCH] D19241: [DependenceAnalysis] Refactor uses of getConstantPart. NFC.

Sanjoy Das via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 18 15:36:52 PDT 2016


sanjoy accepted this revision.
sanjoy added a comment.
This revision is now accepted and ready to land.

lgtm with comments inline


================
Comment at: lib/Analysis/DependenceAnalysis.cpp:2260
@@ +2259,3 @@
+const SCEVConstant *getConstantPart(const SCEV *Expr) {
+  if (const SCEVConstant *Constant = dyn_cast<SCEVConstant>(Expr))
+    return Constant;
----------------
Use `auto *` here and below.

================
Comment at: lib/Analysis/DependenceAnalysis.cpp:2263
@@ +2262,3 @@
+  else if (const SCEVMulExpr *Product = dyn_cast<SCEVMulExpr>(Expr))
+    for (unsigned Op = 0, Ops = Product->getNumOperands(); Op < Ops; Op++)
+      if (const SCEVConstant *Constant =
----------------
Can you just check the first operand?  Operands should be ordered by complexity, so if there is a `SCEVConstant` operand it should come first.


http://reviews.llvm.org/D19241





More information about the llvm-commits mailing list