diff options
| author | Fiona Glaser <escha@apple.com> | 2016-04-06 16:57:25 +0000 |
|---|---|---|
| committer | Fiona Glaser <escha@apple.com> | 2016-04-06 16:57:25 +0000 |
| commit | 045afc4f66711cd56d3e3407935633f1716d4a5f (patch) | |
| tree | 7dad66004adbdd2cbd9bff8d647318ca73f0be71 /llvm/include | |
| parent | a1ca39d3107f5d30f806c3f1b96544fde8dd28db (diff) | |
| download | bcm5719-llvm-045afc4f66711cd56d3e3407935633f1716d4a5f.tar.gz bcm5719-llvm-045afc4f66711cd56d3e3407935633f1716d4a5f.zip | |
Loop Unroll: add options and tweak to make Partial unrolling more useful
1. Add FullUnrollMaxCount option that works like MaxCount, but also limits
the unroll count for fully unrolled loops. So if a loop has an iteration
count over this, it won't fully unroll.
2. Add CLI options for MaxCount and the new option, so they can be tested
(plus a test).
3. Make partial unrolling obey MaxCount.
An example use-case (the out of tree one this is originally designed for) is
a target’s TTI can analyze a loop and decide on a max unroll count separate
from the size threshold, e.g. based on register pressure, then constrain
LoopUnroll to not exceed that, regardless of the size of the unrolled loop.
llvm-svn: 265562
Diffstat (limited to 'llvm/include')
| -rw-r--r-- | llvm/include/llvm/Analysis/TargetTransformInfo.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/llvm/include/llvm/Analysis/TargetTransformInfo.h b/llvm/include/llvm/Analysis/TargetTransformInfo.h index 57d0cf47d6b..13e0729604f 100644 --- a/llvm/include/llvm/Analysis/TargetTransformInfo.h +++ b/llvm/include/llvm/Analysis/TargetTransformInfo.h @@ -260,6 +260,10 @@ public: // (set to UINT_MAX to disable). This does not apply in cases where the // loop is being fully unrolled. unsigned MaxCount; + /// Set the maximum unrolling factor for full unrolling. Like MaxCount, but + /// applies even if full unrolling is selected. This allows a target to fall + /// back to Partial unrolling if full unrolling is above FullUnrollMaxCount. + unsigned FullUnrollMaxCount; /// Allow partial unrolling (unrolling of loops to expand the size of the /// loop body, not only to eliminate small constant-trip-count loops). bool Partial; |

