[PATCH] D22630: Loop rotation

Michael Zolotukhin via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 18 13:09:08 PDT 2016


mzolotukhin added a comment.

> For several loops, after rotation, the header will be non-exiting which is checked already. But that is not true for all rotated loops.
>  Is there a way to find out if an instruction/basic-block was alrady in the loop earlier.

I'd suggest not rotating a loop if its latch is already exiting (instead of looking at the header) and try to rotate otherwise. If we succeeded, then the latch will become exiting, and we won't rotate this loop next time.

If a loop has several exits and for some reason we want to "swap" them, then we definitely need a heuristic to determine when we might want to do this. But I think it would be a very rare occasion, so we can probably not care about it for now.

Michael


https://reviews.llvm.org/D22630





More information about the llvm-commits mailing list