[PATCH] D21720: Unroll for uncountable loops

Evgeny Stupachenko via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri May 26 15:15:08 PDT 2017


evstupac added a comment.

In https://reviews.llvm.org/D21720#766168, @efriedma wrote:

> The use of the "Force" bit here is still really confusing... we need a better way of expressing the profitability of unrolling.


The naming was introduced earlier. Changing it in this patch would be considered as "unrelated change".
"Force" mean we'll unroll loop anyway. For example if user set "pragma unroll(2)" we need to force unrolling (no matter: countable loop or not, it is expensive to calculate tripcount or not...).



================
Comment at: include/llvm/CodeGen/BasicTTIImpl.h:332
+    if (L->getSubLoops().size() == 0 && TM.getOptLevel() > CodeGenOpt::Default)
+      UP.Force = true;
+
----------------
efriedma wrote:
> What effect does this have on performance?
spec performance is unchanged.
However I see performance gain on small loops working with list structures (that is the main reason I'm trying to apply this).
Generally I don't see why we are missing unroll of uncountable loops now. When we are able to prove profitability we should do this.


Repository:
  rL LLVM

https://reviews.llvm.org/D21720





More information about the llvm-commits mailing list