llvm-project/llvm/test/Transforms/LoopUnroll
Hal Finkel 2eed29f3c8 Implement X86TTI::getUnrollingPreferences
This provides an initial implementation of getUnrollingPreferences for x86.
getUnrollingPreferences is used by the generic (concatenation) unroller, which
is distinct from the unrolling done by the loop vectorizer. Many modern x86
cores have some kind of uop cache and loop-stream detector (LSD) used to
efficiently dispatch small loops, and taking full advantage of this requires
unrolling small loops (small here means 10s of uops).

These caches also have limits on the number of taken branches in the loop, and
so we also cap the loop unrolling factor based on the maximum "depth" of the
loop. This is currently calculated with a partial DFS traversal (partial
because it will stop early if the path length grows too much). This is still an
approximation, and one that is both conservative (because it does not account
for branches eliminated via block placement) and optimistic (because it is only
recording the maximum depth over minimum paths). Nevertheless, because the
loops that fit in these uop caches are so small, it is not clear how much the
details matter.

The original set of patches posted for review produced the following test-suite
performance results (from the TSVC benchmark) at that time:
  ControlLoops-dbl - 13% speedup
  ControlLoops-flt - 15% speedup
  Reductions-dbl - 7.5% speedup

llvm-svn: 205348
2014-04-01 18:50:34 +00:00
..
PowerPC Implement TTI getUnrollingPreferences for PowerPC 2013-09-11 21:20:40 +00:00
X86 Implement X86TTI::getUnrollingPreferences 2014-04-01 18:50:34 +00:00
2004-05-13-DontUnrollTooMuch.ll
2005-03-06-BadLoopInfoUpdate.ll
2006-08-24-MultiBlockLoop.ll
2007-04-16-PhiUpdate.ll
2007-05-05-UnrollMiscomp.ll
2007-05-09-UnknownTripCount.ll
2007-11-05-Crash.ll
2011-08-08-PhiUpdate.ll Update Transforms tests to use CHECK-LABEL for easier debugging. No functionality change. 2013-07-14 01:42:54 +00:00
2011-08-09-IVSimplify.ll
2011-08-09-PhiUpdate.ll Fixup to r186268 and r186269: don't append -LABEL to CHECK-NOT. No functionality change. 2013-07-14 02:10:57 +00:00
2011-10-01-NoopTrunc.ll Update Transforms tests to use CHECK-LABEL for easier debugging. No functionality change. 2013-07-14 01:42:54 +00:00
2012-04-09-unroll-indirectbr.ll
basic.ll Update Transforms tests to use CHECK-LABEL for easier debugging. No functionality change. 2013-07-14 01:42:54 +00:00
partial-unroll-optsize.ll
pr10813.ll
pr11361.ll
pr14167.ll Update Transforms tests to use CHECK-LABEL for easier debugging. No functionality change. 2013-07-14 01:42:54 +00:00
runtime-loop.ll
runtime-loop1.ll
runtime-loop2.ll
runtime-loop3.ll Revert the test moves from 176733. Use "REQUIRES: asserts" instead. 2013-03-12 16:27:52 +00:00
scevunroll.ll Update Transforms tests to use CHECK-LABEL for easier debugging. No functionality change. 2013-07-14 01:42:54 +00:00
shifted-tripcount.ll
unloop.ll Update Transforms tests to use CHECK-LABEL for easier debugging. No functionality change. 2013-07-14 01:42:54 +00:00