]> granicus.if.org Git - llvm/commit
[LoopUnrolling] Peel loops with invariant backedge Phi input
authorSanjoy Das <sanjoy@playingwithpointers.com>
Fri, 3 Mar 2017 18:19:15 +0000 (18:19 +0000)
committerSanjoy Das <sanjoy@playingwithpointers.com>
Fri, 3 Mar 2017 18:19:15 +0000 (18:19 +0000)
commita4a7b8d69e9fa5b6fb0b919d7c6f48bb95459ebf
tree33e1b3f0ffd8b904b34640cc006f9532bc63ac2a
parentc4c0c1a3edf0d612f19db43d4875f93ee6437005
[LoopUnrolling] Peel loops with invariant backedge Phi input

Summary:
If a loop contains a Phi node which has an invariant input from back
edge, it is profitable to peel such loops (rather than unroll them) to
use the advantage that this Phi is always invariant starting from 2nd
iteration. After the 1st iteration is peeled, other optimizations can
potentially simplify calculations with this invariant.

Patch by Max Kazantsev!

Reviewers: sanjoy, apilipenko, igor-laevsky, anna, mkuper, reames

Reviewed By: mkuper

Subscribers: mkuper, mzolotukhin, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296898 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/Utils/LoopUnrollPeel.cpp
test/Transforms/LoopUnroll/peel-loop-not-forced.ll [new file with mode: 0644]