1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-21 20:12:56 +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 [Unroll] Do not crash trying to propagate a value to vector load. 2015-09-22 22:27:12 +00:00
full-unroll-heuristics-2.ll [Unroll] Follow-up for r247769: fix a bug in UnrolledInstAnalyzer::visitLoad. 2015-09-22 21:41:29 +00:00
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 LoopUnroll: Use the optsize threshold for minsize as well 2016-01-11 22:39:43 +00:00
pr10813.ll
pr11361.ll
pr14167.ll
pr18861.ll [Tests] Add one more case to LoopUnroll/pr18861.ll for better coverage. 2015-10-02 19:21:52 +00:00
rebuild_lcssa.ll [LoopUnrolling] Fix a bug introduced in r259869 (PR26688). 2016-02-22 21:21:45 +00:00
runtime-loop1.ll DI: Reverse direction of subprogram -> function edge. 2015-11-05 22:03:56 +00:00
runtime-loop2.ll
runtime-loop3.ll
runtime-loop4.ll
runtime-loop5.ll
runtime-loop.ll
scevunroll.ll Revert "[IndVarSimplify] Rewrite loop exit values with their initial values from loop preheader" 2015-11-03 07:14:39 +00:00
shifted-tripcount.ll
tripcount-overflow.ll
unloop.ll LoopInfo: Simplify ownership of Loop objects 2016-01-08 19:08:53 +00:00
unroll-cleanup.ll
unroll-pragmas-disabled.ll
unroll-pragmas.ll
update-loop-info-in-subloops.ll