It makes things easier to understand if this is in a helper method. This is part of my ongoing spaghetti-removal operation on createEmptyLoop.
Details
Diff Detail
- Repository
- rL LLVM
Event Timeline
Hi James,
Thanks for your efforts in cleaning this up. In general, LGTM, with a few remarks inline:
| lib/Transforms/Vectorize/LoopVectorize.cpp | ||
|---|---|---|
| 2572 | DL seems to be unused. And it's not clear from the name, what it stands for. Should it be used instead of OldInduction in setDebugLocFromInst? | |
| 2589 | Should Latch be used instead of Header here? | |
Hi Michael,
Thankyou so much for reviewing my mountain of code reviews :)
Patch updated. I've also taken your advice on other commits and checked all code changes for each commit - there's nothing unexpected in any of them.
Cheers,
James
| lib/Transforms/Vectorize/LoopVectorize.cpp | ||
|---|---|---|
| 2572 | Good catch, thanks! Updated. | |
| 2589 | I don't think so - Induction is in the latch and needs to branch back to the header. | |
| lib/Transforms/Vectorize/LoopVectorize.cpp | ||
|---|---|---|
| 2589 | 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? | |
DL seems to be unused. And it's not clear from the name, what it stands for. Should it be used instead of OldInduction in setDebugLocFromInst?