[PATCH] D21720: Unroll for uncountable loops

Hal Finkel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 9 19:26:23 PST 2017


hfinkel added a comment.

In https://reviews.llvm.org/D21720#697188, @evstupac wrote:

> > In any case, there is definitely a more-general case we can handle here, but it is the following: there needs to either be a cycle PHI, or a use of an otherwise-unused instruction variable that repeats in a fixed pattern, such that unrolling the loop by the length of that pattern allows us to eliminate the PHI. i&C and i%C have that property. Is there anything else?
>
> "i/C" could also be optimized when "i" starts from "k*C". However we'll need to lower it (replace with new IV) in later optimizations (for example LSR).
>
> What about cases 1. and 2. ?


Case 1 sounds good, but maybe our existing heuristic should get it? I don't understand what you mean in case 2.


Repository:
  rL LLVM

https://reviews.llvm.org/D21720





More information about the llvm-commits mailing list