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

Michael Zolotukhin via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 1 11:21:58 PDT 2015


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





More information about the llvm-commits mailing list