[PATCH] D43876: [LoopUnroll] Peel off iterations if it makes conditions true/false.

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 8 01:19:58 PST 2018


fhahn added a comment.

In https://reviews.llvm.org/D43876#1031076, @samparker wrote:

> Just FYI, I am also currently working on a pass to handle slightly more generic cases within the loop body, such like:
>
> for (unsigned i = 0; i; i < 1000; ++i) {
>
>   if (i < M)
>   ... something
>   else
>   ... something else
>
> }
>
> My transformation operates on the unrolled version and also attempts to remove selects if the loop body has been simplified into one block. Hopefully I will be able to get an initial version up for review and discussion next week.


Interesting. What transformation is this pass doing? Loop peeling should handle cases like that for constant bounds. Non-constant bounds still won't be peeled, so it should not interfere with your transformation.


https://reviews.llvm.org/D43876





More information about the llvm-commits mailing list