[PATCH] D62989: [Unroll] Do NOT unroll a loop with small runtime upperbound

Hal Finkel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 10 16:32:19 PDT 2019


hfinkel added inline comments.


================
Comment at: lib/Transforms/Scalar/LoopUnrollPass.cpp:795
+  if (!(UP.UpperBound || MaxOrZero) || UnrollByMaxCount > UnrollMaxUpperBound)
+    UnrollByMaxCount = 0;
+
----------------
Did you make this new variable so that you could apply this `!(UP.UpperBound || MaxOrZero) || UnrollByMaxCount > UnrollMaxUpperBound` condition only to full-unrolling case and not to the partial unrolling case?


================
Comment at: lib/Transforms/Scalar/LoopUnrollPass.cpp:1097
   // count.
+  unsigned MaxTripCount = 0;
   bool MaxOrZero = false;
----------------
Why did this move down here?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D62989/new/

https://reviews.llvm.org/D62989





More information about the llvm-commits mailing list