From d9f3f4548e50b3468211c9113f6bf91b3788450c Mon Sep 17 00:00:00 2001 From: Nadav Rotem Date: Sun, 14 Jul 2013 06:15:46 +0000 Subject: [PATCH] SLPVectorizer: change the order in which we search for vectorization candidates. Do stores first and PHIs second. llvm-svn: 186277 --- llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp b/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp index 12316b4..5449f39 100644 --- a/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp +++ b/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp @@ -1522,15 +1522,15 @@ struct SLPVectorizer : public FunctionPass { e = po_end(&F.getEntryBlock()); it != e; ++it) { BasicBlock *BB = *it; - // Vectorize trees that end at reductions. - Changed |= vectorizeChainsInBlock(BB, R); - // Vectorize trees that end at stores. if (unsigned count = collectStores(BB, R)) { (void)count; DEBUG(dbgs() << "SLP: Found " << count << " stores to vectorize.\n"); Changed |= vectorizeStoreChains(R); } + + // Vectorize trees that end at reductions. + Changed |= vectorizeChainsInBlock(BB, R); } if (Changed) { @@ -1653,7 +1653,7 @@ bool SLPVectorizer::vectorizeStores(ArrayRef Stores, bool Changed = false; // Do a quadratic search on all of the given stores and find - // all of the pairs of loads that follow each other. + // all of the pairs of stores that follow each other. for (unsigned i = 0, e = Stores.size(); i < e; ++i) for (unsigned j = 0; j < e; ++j) { if (i == j) -- 2.7.4