[PATCH] D25739: [IndVarSimplify] Teach calculatePostIncRange to take guards into account

Sanjoy Das via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 18 14:35:22 PDT 2016


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

lgtm with nits inline



================
Comment at: lib/Transforms/Scalar/IndVarSimplify.cpp:890
 
+  bool HasGuards;
+
----------------
Add a one-liner here on what this is for.


================
Comment at: lib/Transforms/Scalar/IndVarSimplify.cpp:1610
+
+    for (BasicBlock::reverse_iterator I = Ctx->getIterator().getReverse(),
+                 E = Ctx->getParent()->rend(); I != E; I++) {
----------------
Can you use `make_range` here?


================
Comment at: test/Transforms/IndVarSimplify/post-inc-range.ll:152
+  br label %for.inc
+
+for.inc:
----------------
Can you also add a test case where you've not broken the block?  That is, the loop has only one basic block?


https://reviews.llvm.org/D25739





More information about the llvm-commits mailing list