[PATCH] D32261: [LoopUnroll] Don't try to unroll non-rotated loops

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 20 16:00:56 PDT 2017


efriedma added a comment.

> The underlying problem is: What can or should happen when a loop is irreducible?

There is no "underlying problem" here.  An LLVM "Loop*" always refers to a natural loop; unrolling a Loop is always a well-defined operation (unless we're dealing with something weird like indirectbr).  See LoopInfo.h.  Our current implementation of loop unrolling only knows how to unroll loops with exactly one latch which is a conditional branch that exits the loop, but that isn't fundamental to the algorithm.  We could unroll loops with a more complicated latch, or multiple latches; it's just a matter of teaching the algorithm how to fix up the latches correctly.


https://reviews.llvm.org/D32261





More information about the llvm-commits mailing list