OSDN Git Service

[LoopUnroll] Peel off iterations if it makes conditions true/false.
authorFlorian Hahn <florian.hahn@arm.com>
Thu, 15 Mar 2018 21:34:43 +0000 (21:34 +0000)
committerFlorian Hahn <florian.hahn@arm.com>
Thu, 15 Mar 2018 21:34:43 +0000 (21:34 +0000)
commit648727d7b98bacb615a8be81ea0b4b74b6d8f409
tree164495e3fed0e12b6796d68798b11538106ebcd5
parent58e2c599eb39669734b748be9afb4746f10ff470
[LoopUnroll] Peel off iterations if it makes conditions true/false.

If the loop body contains conditions of the form IndVar < #constant, we
can remove the checks by peeling off #constant iterations.

This improves codegen for PR34364.

Reviewers: mkuper, mkazantsev, efriedma

Reviewed By: mkazantsev

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@327671 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/Transforms/Utils/UnrollLoop.h
lib/Transforms/Scalar/LoopUnrollPass.cpp
lib/Transforms/Utils/LoopUnrollPeel.cpp
test/Transforms/LoopUnroll/complete_unroll_profitability_with_assume.ll
test/Transforms/LoopUnroll/peel-loop-conditions.ll [new file with mode: 0644]