[PATCH] D30757: [LoopUnroll] Handle loops where the exiting block is different from the latch

Michael Kuperstein via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 15 17:23:21 PDT 2017


mkuper added a comment.

In https://reviews.llvm.org/D30757#702406, @mzolotukhin wrote:

> > Do you know if we already have a utility somewhere that detects this?
>
> Can we require the loop to be in a simplified form and its latch to be exiting? Will it suffice?


Maybe?

It will certainly squash this bug, not sure about the others. 
We already sort of try to do this - UnrollLoop() bails if the latch is not conditional. I assume the expectation is that one of the edges is the backedge, and the other is the exiting edge, but I don't think this is actually enforced, and it looks like unrolling (as opposed to peeling) manages to deal with it.


https://reviews.llvm.org/D30757





More information about the llvm-commits mailing list