1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-23 13:02:52 +02:00
llvm-mirror/test/Transforms/LoopUnroll
Justin Lebar 19453c8511 [LoopUnroll] Respect the convergent attribute.
Summary:
Specifically, when we perform runtime loop unrolling of a loop that
contains a convergent op, we can only unroll k times, where k divides
the loop trip multiple.

Without this change, we'll happily unroll e.g. the following loop

  for (int i = 0; i < N; ++i) {
    if (i == 0) convergent_op();
    foo();
  }

into

  int i = 0;
  if (N % 2 == 1) {
    convergent_op();
    foo();
    ++i;
  }
  for (; i < N - 1; i += 2) {
    if (i == 0) convergent_op();
    foo();
    foo();
  }.

This is unsafe, because we've just added a control-flow dependency to
the convergent op in the prelude.

In general, runtime unrolling loops that contain convergent ops is safe
only if we don't have emit a prelude, which occurs when the unroll count
divides the trip multiple.

Reviewers: resistor

Subscribers: llvm-commits, mzolotukhin

Differential Revision: http://reviews.llvm.org/D17526

llvm-svn: 263509
2016-03-14 23:15:34 +00:00
..
AArch64
AMDGPU AMDGPU: Remove some old intrinsic uses from tests 2016-02-11 06:02:01 +00:00
PowerPC
X86
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
2011-08-09-IVSimplify.ll
2011-08-09-PhiUpdate.ll
2011-10-01-NoopTrunc.ll
2012-04-09-unroll-indirectbr.ll
basic.ll
convergent.ll [LoopUnroll] Respect the convergent attribute. 2016-03-14 23:15:34 +00:00
ephemeral.ll
full-unroll-bad-cost.ll
full-unroll-crashers.ll
full-unroll-heuristics-2.ll
full-unroll-heuristics-cmp.ll [LoopUnroll] Convert some existing tests to unit-tests. 2016-03-12 01:28:56 +00:00
full-unroll-heuristics-phi-prop.ll
full-unroll-heuristics.ll
high-cost-trip-count-computation.ll [SCEVExpander] Make findExistingExpansion smarter 2016-02-16 06:46:58 +00:00
ignore-annotation-intrinsic-cost.ll
loop-remarks.ll
nsw-tripcount.ll
partial-unroll-optsize.ll
pr10813.ll
pr11361.ll
pr14167.ll
pr18861.ll
rebuild_lcssa.ll [LoopUnrolling] Fix a bug introduced in r259869 (PR26688). 2016-02-22 21:21:45 +00:00
runtime-loop1.ll
runtime-loop2.ll
runtime-loop3.ll
runtime-loop4.ll
runtime-loop5.ll
runtime-loop.ll
scevunroll.ll
shifted-tripcount.ll
tripcount-overflow.ll
unloop.ll
unroll-cleanup.ll
unroll-pragmas-disabled.ll
unroll-pragmas.ll
update-loop-info-in-subloops.ll