[PATCH] D21720: Unroll for uncountable loops

Hal Finkel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 14 07:32:30 PDT 2017


hfinkel added a comment.

In https://reviews.llvm.org/D21720#698373, @evstupac wrote:

> > Not really... I mean, we have PartialThreshold as a maximum size for the whole unrolled loop, but that isn't sensitive to the dynamic cost savings.  (Compare to getFullUnrollBoostingFactor for complete unrolling.)
>
> Right. But full unroll is the only exception.
>  And yes this threshold is not that accurate, but it bounds loop unrolling. And it will bound uncountable loops unroll as well.


Okay, so is the general plan here to?

1. Generally allow unrolling of uncountable loops
2. Adjust the profitability heuristic to account for the cost of the branches for the uncountable case
3. Include, as necessary, in our general profitability heuristic (if we don't get this naturally), savings from phi-derived values which are cyclic with a small cycle length (like the s = -s case).


Repository:
  rL LLVM

https://reviews.llvm.org/D21720





More information about the llvm-commits mailing list