[PATCH] D12474: [LV] Factor the creation of the loop induction variable out of createEmptyLoop()

James Molloy via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 1 11:50:47 PDT 2015


Hi Michael,

ASCII art beats all :) yes you are right. It should be latch. At the moment
the new loop will only ever have a single block, so header == latch. But
the code should be updated. Thanks!

James
On Tue, 1 Sep 2015 at 19:22, Michael Zolotukhin via llvm-commits <
llvm-commits at lists.llvm.org> wrote:

> mzolotukhin added inline comments.
>
> ================
> Comment at: lib/Transforms/Vectorize/LoopVectorize.cpp:2589
> @@ +2588,3 @@
> +  Induction->addIncoming(Start, L->getLoopPreheader());
> +  Induction->addIncoming(Next, Header);
> +  // Create the compare.
> ----------------
> AFAIU, we have a following CFG:
> ```
> (PreHeader)
>     |
>     |
>     v
> (Header)<-
>     |     |
>     |     |
>     v     /
> (Latch) --
>     |
>     |
>     v
> (Exit)
> ```
> (If my graphics isn't rendered well, the edges in CFG are:
> PreHeader-->Header, Header-->Latch, Latch-->Header, Latch-->Exit)
>
> Now, we're building `Induction` in `Header`. It is a PHI, and should have
> two incoming values: one from the preheader (`L->getLoopPreheader`), and
> one from the latch (but you use `Header` instead).
>
> Am I wrong somewhere?
>
>
> Repository:
>   rL LLVM
>
> http://reviews.llvm.org/D12474
>
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150901/8490b5d0/attachment.html>


More information about the llvm-commits mailing list