[LV] Remove implicit single basic block assumption
ClosedPublic

Authored by gilr on Apr 13 2017, 12:55 PM.

Details

Summary

This patch is part of D28975's breakdown - no change in output intended.

LV's code currently assumes the vectorized loop is a single basic block up until predicateInstructions() is called. This patch removes two manifestations of this assumption (loop phi incoming values, dominator tree update) by replacing the use of vectorLoopBody with the vectorized loop's latch/header.

Diff Detail

Repository
rL LLVM
gilr created this revision.Apr 13 2017, 12:55 PM
mkuper accepted this revision.Apr 13 2017, 1:00 PM

LGTM

lib/Transforms/Vectorize/LoopVectorize.cpp
5054 ↗(On Diff #95178)

Should this be

DT->addNewBlock(LI->getLoopFor(LoopVectorBody)->getHeader(), LoopVectorPreHeader);

as long as we're at it?

This revision is now accepted and ready to land.Apr 13 2017, 1:00 PM
gilr marked an inline comment as done.Apr 13 2017, 11:50 PM
gilr edited the summary of this revision. (Show Details)Apr 14 2017, 12:05 AM
gilr updated this revision to Diff 95275.Apr 14 2017, 12:15 AM

Applied Michael's comment and removed the comment explaining how using the body as header/latch is safe at this point.

This revision was automatically updated to reflect the committed changes.