Loop Unroll: add options and tweak to make Partial unrolling more useful
authorFiona Glaser <escha@apple.com>
Wed, 6 Apr 2016 16:57:25 +0000 (16:57 +0000)
committerFiona Glaser <escha@apple.com>
Wed, 6 Apr 2016 16:57:25 +0000 (16:57 +0000)
commit045afc4f66711cd56d3e3407935633f1716d4a5f
tree7dad66004adbdd2cbd9bff8d647318ca73f0be71
parenta1ca39d3107f5d30f806c3f1b96544fde8dd28db
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
llvm/include/llvm/Analysis/TargetTransformInfo.h
llvm/lib/Transforms/Scalar/LoopUnrollPass.cpp