[PATCH] D91481: [LoopUnroll] Discount uniform instructions in cost models

Philip Reames via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 1 09:08:14 PST 2020


reames added inline comments.


================
Comment at: llvm/lib/Transforms/Scalar/LoopUnrollPass.cpp:769
+    // iterations.  We should break the backedge, not unroll that.
+    if (LocalUniformSize + UP.BEInsns + 1 > LoopSize)
+      LocalUniformSize = 0;
----------------
Whitney wrote:
> Do we need a test case for this case where the loop is not unrolled because the entire loop body is uniform?
Any suggestions on how to write one?  This was mostly defensive programming.  Every loop structure I can think of is either a) infinite, or b) involves at least two instructions.  Given BEInst is configurable (why?)  the later isn't quite enough to fully disallow the case.


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

https://reviews.llvm.org/D91481



More information about the llvm-commits mailing list