[PATCH] D22630: Loop rotation

Daniel Berlin via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 21 12:41:42 PDT 2016


On Thu, Jul 21, 2016 at 8:40 AM, Aditya Kumar via llvm-commits <
llvm-commits at lists.llvm.org> wrote:

> hiraditya created this revision.
> hiraditya added reviewers: hfinkel, sanjoy.
> hiraditya added subscribers: mzolotukhin, sebpop, jlebar, llvm-commits.
> Herald added a subscriber: sanjoy.
>
> This patch implements Loop Rotation Pass:
>
>  1. Canonicalize loop latch to have only one successor.
>  2. Clone all the BBs which are exiting the loop.
>  3. Adjust phi of cloned BBs
>  4. Add phi to the new loop header
>  5. Update DOM
>
> With this patch all the basic blocks which are exiting the loop can be
> copied during rotation. This is helpful for passes like gvn/licm which can
> now remove loop invariant code
> because some computations (which might not dominate all the basic blocks
> of loop) can now be PRE'd as they are available outside of the loop (due to
> loop rotation).
>

Can you give specific examples?

If these are simply bad choices our PRE makes, we can just fix PRE instead
of rotate loops to fix PRE :)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160721/93e60dd8/attachment.html>


More information about the llvm-commits mailing list