]> granicus.if.org Git - llvm/commit
[LoopUnroll] Allow unrolling if the unrolled size does not exceed loop size.
authorFlorian Hahn <flo@fhahn.com>
Wed, 17 Apr 2019 15:57:43 +0000 (15:57 +0000)
committerFlorian Hahn <flo@fhahn.com>
Wed, 17 Apr 2019 15:57:43 +0000 (15:57 +0000)
commit2d05b980444753b94a7baec330fcb5a622c875f8
treebad4e98e3d1233a98588fc9c32c6dc47be5cf75c
parent03f53c0c4dc904789fe791eb97bcedaca852fe4a
[LoopUnroll] Allow unrolling if the unrolled size does not exceed loop size.

Summary:
In the following cases, unrolling can be beneficial, even when
optimizing for code size:
 1) very low trip counts
 2) potential to constant fold most instructions after fully unrolling.

We can unroll in those cases, by setting the unrolling threshold to the
loop size. This might highlight some cost modeling issues and fixing
them will have a positive impact in general.

Reviewers: vsk, efriedma, dmgreen, paquette

Reviewed By: paquette

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@358586 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/Scalar/LoopUnrollPass.cpp
test/Transforms/LoopUnroll/AArch64/unroll-optsize.ll [new file with mode: 0644]