[PATCH] D60266: [LoopUnroll] Rotate loop, when optimizing for size and can fully unroll a loop.

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed May 15 13:51:37 PDT 2019


fhahn added a comment.

In D60266#1455299 <https://reviews.llvm.org/D60266#1455299>, @efriedma wrote:

> Why do we need to rotate the loop before unrolling?  llvm::UnrollLoop currently refuses to unroll loops where the latch is an unconditional branch, but that isn't a fundamental limitation, as far as I can tell.  We already support unrolling loops where the latch is not the exit branch; allowing loops where the latch doesn't exit at all is a minor extension.  Granted, it might be more efficient to explicitly rotate the loop before unrolling, so we don't clone quite so much code.


It looks like there is not too much work needed to support loops with unconditional latches with exiting headers. I've put up a patch: D61962 <https://reviews.llvm.org/D61962>. Still needs a bit more evaluating of the impact on code-size/performance. It is more aggressive than this patch.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D60266/new/

https://reviews.llvm.org/D60266





More information about the llvm-commits mailing list