[PATCH] D102635: [LoopUnroll] Use tripcount from exiting header, if latch not exiting.

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon May 17 10:09:47 PDT 2021


nikic added a comment.

In D102635#2763879 <https://reviews.llvm.org/D102635#2763879>, @Meinersbur wrote:

> However, I wonder why it is not using the overloads without BB arguments. At the end, unrolling would be only interested in some max trip count imposed by any exit, not of a specific one.

Full unrolling can operate in a number of different modes. Max tripcount is one of them, but is actually disabled on most targets (maybe it shouldn't be...) The one this targets is an exact tripcount on one exit, which is generally enabled. The exact tripcount case will always eliminate branches for one exit (though there may be others), while max tripcount will effectively retain all branches.

Unfortunately the loop unrolling implementation currently has some implicit contracts about what kinds of loops it can unroll -- e.g. it would be great if this worked even if the latch were exiting (but had no exact exit count itself), but that does wouldn't work out of the box.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D102635



More information about the llvm-commits mailing list