[PATCH] D21720: Unroll for uncountable loops

Evgeny Stupachenko via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 10 14:49:22 PST 2017


evstupac added a comment.

> Conversely, unrolling a large loop just to eliminate one branch is probably a bad idea.

That is bounded by thresholds.

> This patch is trying to solve the problem for certain cases... but the approach is kind of awkward: rather than actually moving the profitability check,
>  it adds a special case to set the "Force" bit for certain loops.

Isn't it the same for Runtime, Partial? Setting count means almost the same. Count of 1 or 0 means we'll act in the same way if Runtime is false. I can rewrite this and set Force to true by default (but set count to 0 or 1 for uncountable loops, that do not meet some conditions).
And yes you are right we need to move all profitability checks from Utils/LoopUnrollRuntime.cpp to Scalar/LoopUnrollPass.cpp (I plan to do this in another patch).,


Repository:
  rL LLVM

https://reviews.llvm.org/D21720





More information about the llvm-commits mailing list