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

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 4 11:58:16 PDT 2019


efriedma added a comment.

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.

On a related note, independent of what we do in unrolling, it would probably be worthwhile to teach loop rotation to rotate loops where the cloned header would fold to zero instructions.


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