SLP: When searching for vectorization opportunities scan the blocks in post-order because we grow chains upwards.

llvm-svn: 185041
This commit is contained in:
Nadav Rotem 2013-06-26 23:44:45 +00:00
parent 7f0d6d7975
commit 93f880fb77
1 changed files with 4 additions and 2 deletions

View File

@ -1377,8 +1377,10 @@ struct SLPVectorizer : public FunctionPass {
// he store instructions.
FuncSLP R(&F, SE, DL, TTI, AA, LI, DT);
for (Function::iterator it = F.begin(), e = F.end(); it != e; ++it) {
BasicBlock *BB = it;
// Scan the blocks in the function in post order.
for (po_iterator<BasicBlock*> it = po_begin(&F.getEntryBlock()),
e = po_end(&F.getEntryBlock()); it != e; ++it) {
BasicBlock *BB = *it;
// Vectorize trees that end at reductions.
Changed |= vectorizeChainsInBlock(BB, R);