[PATCH] D60265: [LoopUnroll] Allow unrolling if the unrolled size does not exceed loop size.

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 4 07:23:10 PDT 2019


fhahn created this revision.
fhahn added reviewers: vsk, efriedma, dmgreen, paquette.
Herald added subscribers: zzheng, hiraditya, javed.absar.
Herald added a project: LLVM.

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.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D60265

Files:
  llvm/lib/Transforms/Scalar/LoopUnrollPass.cpp
  llvm/test/Transforms/LoopUnroll/AArch64/unroll-optsize.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D60265.193702.patch
Type: text/x-patch
Size: 7783 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190404/97d10399/attachment.bin>


More information about the llvm-commits mailing list