[PATCH] D24451: [LoopUnroller] Replace UnrollingPreferences::Force with ForceMaxCount + SystemZ getUnrollingPreferences().

Jonas Paulsson via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 16 23:24:26 PDT 2016


jonpa added a comment.

> > Having worked with this patch for a while, it has become clear that the *exact number of iterations* produced needs to be controlled. The resulting loop should have no more than 12 stores, and it seems bad to have more than 3 exit branches w/ forced unrolling.

> 




> Is this true for other unroll candidates (Partial, Runtime)? I'm trying to understand what is so specific about Force unroll.


All loops are bounded by number of stores. The difference with forced unrolling is that I want to use a general bound (max 3 iterations.). So even if there are no stores, there is still a limit. The produced loops are different with -force, and benchmarks have shown this is better (to not get e.g. 8 iterations with exit branches, but just 2-3).

> If You need to control number of stores/branches you can limit MaxCount for all kinds of unroll. Or even better - calculate specific count for your architecture based on number of stores/branches.


This is what the patch is doing, except it doesn't limit on branches for partial / runtime.


https://reviews.llvm.org/D24451





More information about the llvm-commits mailing list