[PATCH] D41953: [LoopUnroll] Unroll and Jam

Dávid Bolvanský via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon May 21 11:33:43 PDT 2018


xbolva00 added inline comments.


================
Comment at: lib/Transforms/Scalar/LoopUnrollAndJamPass.cpp:136
+  assert(LoopSize >= UP.BEInsns && "LoopSize should not be less than BEInsns!");
+  return (uint64_t)(LoopSize - UP.BEInsns) * UP.Count + UP.BEInsns;
+}
----------------
static_cast?


================
Comment at: lib/Transforms/Utils/LoopUnrollAndJam.cpp:174
+  // Are we eliminating the loop control altogether?
+  bool CompletelyUnroll = Count == TripCount;
+
----------------
bool CompletelyUnroll = (Count == TripCount);
maybe better?


================
Comment at: lib/Transforms/Utils/LoopUnrollAndJam.cpp:435
+
+  for (unsigned It = 1; It < Count; It++) {
+    // Remap ForeBlock successors from previous iteration to this
----------------
Above you use a different style:
for (unsigned It = 1; It != Count; ++It) {

Can you make it same for all occurrences?


================
Comment at: lib/Transforms/Utils/LoopUnrollAndJam.cpp:474
+  } else {
+    BranchInst *Term = cast<BranchInst>(AftBlocksLast.back()->getTerminator());
+    Term->setSuccessor(!ContinueOnTrue, ForeBlocksFirst[0]);
----------------
This line could be placed above the condition.


https://reviews.llvm.org/D41953





More information about the llvm-commits mailing list