[PATCH] D44983: [LoopUnroll] Only peel if a predicate becomes known in the loop body.

Max Kazantsev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 29 22:43:23 PDT 2018


mkazantsev added a comment.

In https://reviews.llvm.org/D44983#1051407, @fhahn wrote:

> In https://reviews.llvm.org/D44983#1051403, @mkazantsev wrote:
>
> > I see the point, but predicate being true or false on `K+1`th iteration also does not guarantee that we can simplify the loop. I can agree that it is better than what we have now, I just wonder if this solution is general enough to deal with problem you are dealing with.
>
>
> Ah yes, I see the case you are referring to now. Maybe it would be worth to add a check for monotonic predicates?


As an option, yes. Alternatively, you know the number of iterations you are peeling out, meaning that you can use `evaluateAtIteration` to get what remains in loop after your manipulations. If the predicate or !predicate is known for this value, then it is what we want.


https://reviews.llvm.org/D44983





More information about the llvm-commits mailing list