forked from OSchip/llvm-project
751579cac0
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 |
||
---|---|---|
.. | ||
AArch64 | ||
AMDGPU | ||
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 | ||
ephemeral.ll | ||
epilog_const_phi.ll | ||
full-unroll-bad-cost.ll | ||
full-unroll-crashers.ll | ||
full-unroll-heuristics-2.ll | ||
full-unroll-heuristics-cmp.ll | ||
full-unroll-heuristics-dce.ll | ||
full-unroll-heuristics-geps.ll | ||
full-unroll-heuristics-phi-prop.ll | ||
full-unroll-heuristics.ll | ||
full-unroll-keep-first-exit.ll | ||
high-cost-trip-count-computation.ll | ||
ignore-annotation-intrinsic-cost.ll | ||
loop-remarks-with-hotness.ll | ||
loop-remarks.ll | ||
partial-unroll-const-bounds.ll | ||
peel-loop-irreducible.ll | ||
peel-loop-negative.ll | ||
peel-loop-not-forced.ll | ||
peel-loop-pgo.ll | ||
peel-loop.ll | ||
peel-loop2.ll | ||
pr10813.ll | ||
pr11361.ll | ||
pr14167.ll | ||
pr18861.ll | ||
pr27157.ll | ||
pr28132.ll | ||
pr31718.ll | ||
rebuild_lcssa.ll | ||
revisit.ll | ||
runtime-li.ll | ||
runtime-loop.ll | ||
runtime-loop1.ll | ||
runtime-loop2.ll | ||
runtime-loop3.ll | ||
runtime-loop4.ll | ||
runtime-loop5.ll | ||
scevunroll.ll | ||
shifted-tripcount.ll | ||
tripcount-overflow.ll | ||
unloop.ll | ||
unroll-cleanup.ll | ||
unroll-cleanuppad.ll | ||
unroll-count.ll | ||
unroll-heuristics-pgo.ll | ||
unroll-opt-attribute.ll | ||
unroll-pragmas-disabled.ll | ||
unroll-pragmas.ll | ||
update-loop-info-in-subloops.ll |