[llvm] r186277 - SLPVectorizer: change the order in which we search for vectorization candidates. Do stores first and PHIs second.

Nadav Rotem nrotem at apple.com
Sat Jul 13 23:15:46 PDT 2013


Author: nadav
Date: Sun Jul 14 01:15:46 2013
New Revision: 186277

URL: http://llvm.org/viewvc/llvm-project?rev=186277&view=rev
Log:
SLPVectorizer: change the order in which we search for vectorization candidates. Do stores first and PHIs second.

Modified:
    llvm/trunk/lib/Transforms/Vectorize/SLPVectorizer.cpp

Modified: llvm/trunk/lib/Transforms/Vectorize/SLPVectorizer.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Vectorize/SLPVectorizer.cpp?rev=186277&r1=186276&r2=186277&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Vectorize/SLPVectorizer.cpp (original)
+++ llvm/trunk/lib/Transforms/Vectorize/SLPVectorizer.cpp Sun Jul 14 01:15:46 2013
@@ -1522,15 +1522,15 @@ struct SLPVectorizer : public FunctionPa
          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(Arra
   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)





More information about the llvm-commits mailing list