llvm-project/llvm/test/Transforms/LoopUnroll
Max Kazantsev 751579cac0 [LoopPeeling] Get rid of Phis that become invariant after N steps
This patch is a generalization of the improvement introduced in rL296898.
Previously, we were able to peel one iteration of a loop to get rid of a Phi that becomes
an invariant on the 2nd iteration. In more general case, if a Phi becomes invariant after
N iterations, we can peel N times and turn it into invariant.
In order to do this, we for every Phi in loop's header we define the Invariant Depth value
which is calculated as follows:

Given %x = phi <Inputs from above the loop>, ..., [%y, %back.edge].

If %y is a loop invariant, then Depth(%x) = 1.
If %y is a Phi from the loop header, Depth(%x) = Depth(%y) + 1.
Otherwise, Depth(%x) is infinite.
Notice that if we peel a loop, all Phis with Depth = 1 become invariants,
and all other Phis with finite depth decrease the depth by 1.
Thus, peeling N first iterations allows us to turn all Phis with Depth <= N
into invariants.

Reviewers: reames, apilipenko, mkuper, skatkov, anna, sanjoy

Reviewed By: sanjoy

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D31613

llvm-svn: 300446
2017-04-17 09:52:02 +00:00
..
AArch64 Reapply "[LoopUnroll] Use the upper bound of the loop trip count to fullly unroll a loop" 2016-10-12 21:29:38 +00:00
AMDGPU AMDGPU: Mark all unspecified CC functions in tests as amdgpu_kernel 2017-03-21 21:39:51 +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 [PM] Teach LoopUnroll to update the LPM infrastructure as it unrolls 2017-01-25 02:49:01 +00:00
convergent.ll
ephemeral.ll
epilog_const_phi.ll Add test missed in r296770. 2017-03-04 05:20:02 +00:00
full-unroll-bad-cost.ll [PM] Simplify the new PM interface to the loop unroller and expose two 2017-01-26 02:13:50 +00:00
full-unroll-crashers.ll [PM] Simplify the new PM interface to the loop unroller and expose two 2017-01-26 02:13:50 +00:00
full-unroll-heuristics-2.ll [PM] Simplify the new PM interface to the loop unroller and expose two 2017-01-26 02:13:50 +00:00
full-unroll-heuristics-cmp.ll [PM] Simplify the new PM interface to the loop unroller and expose two 2017-01-26 02:13:50 +00:00
full-unroll-heuristics-dce.ll [PM] Simplify the new PM interface to the loop unroller and expose two 2017-01-26 02:13:50 +00:00
full-unroll-heuristics-geps.ll [PM] Simplify the new PM interface to the loop unroller and expose two 2017-01-26 02:13:50 +00:00
full-unroll-heuristics-phi-prop.ll [PM] Simplify the new PM interface to the loop unroller and expose two 2017-01-26 02:13:50 +00:00
full-unroll-heuristics.ll [PM] Simplify the new PM interface to the loop unroller and expose two 2017-01-26 02:13:50 +00:00
full-unroll-keep-first-exit.ll [PM] Simplify the new PM interface to the loop unroller and expose two 2017-01-26 02:13:50 +00:00
high-cost-trip-count-computation.ll
ignore-annotation-intrinsic-cost.ll
loop-remarks-with-hotness.ll
loop-remarks.ll
partial-unroll-const-bounds.ll [PM] Simplify the new PM interface to the loop unroller and expose two 2017-01-26 02:13:50 +00:00
peel-loop-irreducible.ll [LoopUnroll] Don't peel loops where the latch isn't the exiting block 2017-03-16 21:07:48 +00:00
peel-loop-negative.ll [LoopPeeling] Fix condition for phi-eliminating peeling 2017-04-17 05:38:28 +00:00
peel-loop-not-forced.ll [LoopPeeling] Get rid of Phis that become invariant after N steps 2017-04-17 09:52:02 +00:00
peel-loop-pgo.ll [LoopUnroll] Enable PGO-based loop peeling by default. 2017-02-22 00:27:34 +00:00
peel-loop.ll Update domtree incrementally in loop peeling. 2017-01-24 06:58:39 +00:00
peel-loop2.ll [LoopUnroll] Remap references in peeled iteration 2017-03-26 16:46:53 +00:00
pr10813.ll
pr11361.ll
pr14167.ll
pr18861.ll
pr27157.ll
pr28132.ll
pr31718.ll [LoopUnroll] First form LCSSA, then loop-simplify 2017-01-23 23:45:42 +00:00
rebuild_lcssa.ll [LoopSimplify] When simplifying phis in loop-simplify, do it only if it preserves LCSSA form. 2016-09-27 21:03:45 +00:00
revisit.ll The patch turns on epilogue unroll for loops with constant recurency start. 2017-03-02 17:38:46 +00:00
runtime-li.ll [LoopUnroll] Properly update loopinfo for runtime unrolling by 2 2017-01-26 01:04:11 +00:00
runtime-loop.ll [PM] Teach LoopUnroll to update the LPM infrastructure as it unrolls 2017-01-25 02:49:01 +00:00
runtime-loop1.ll [PM] Teach LoopUnroll to update the LPM infrastructure as it unrolls 2017-01-25 02:49:01 +00:00
runtime-loop2.ll [PM] Teach LoopUnroll to update the LPM infrastructure as it unrolls 2017-01-25 02:49:01 +00:00
runtime-loop3.ll The patch fixes r296770 2017-03-02 19:41:38 +00:00
runtime-loop4.ll
runtime-loop5.ll The patch turns on epilogue unroll for loops with constant recurency start. 2017-03-02 17:38:46 +00:00
scevunroll.ll
shifted-tripcount.ll
tripcount-overflow.ll
unloop.ll [PM] Teach LoopUnroll to update the LPM infrastructure as it unrolls 2017-01-25 02:49:01 +00:00
unroll-cleanup.ll
unroll-cleanuppad.ll
unroll-count.ll
unroll-heuristics-pgo.ll The patch turns on epilogue unroll for loops with constant recurency start. 2017-03-02 17:38:46 +00:00
unroll-opt-attribute.ll
unroll-pragmas-disabled.ll
unroll-pragmas.ll The patch turns on epilogue unroll for loops with constant recurency start. 2017-03-02 17:38:46 +00:00
update-loop-info-in-subloops.ll [PM] Teach LoopUnroll to update the LPM infrastructure as it unrolls 2017-01-25 02:49:01 +00:00