aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Transforms/Vectorize/SLPVectorizer.cpp
diff options
context:
space:
mode:
authorNadav Rotem <nrotem@apple.com>2013-07-14 06:15:46 +0000
committerNadav Rotem <nrotem@apple.com>2013-07-14 06:15:46 +0000
commit6611eaa32f7941dd50a3ffe608f3f4a7665dbe91 (patch)
tree98ec8cdacb4f697d669edd8d13bfd463d83613c0 /lib/Transforms/Vectorize/SLPVectorizer.cpp
parent83d63f8a4dca45d1bba13710c26b4173ace58a65 (diff)
downloadexternal_llvm-6611eaa32f7941dd50a3ffe608f3f4a7665dbe91.zip
external_llvm-6611eaa32f7941dd50a3ffe608f3f4a7665dbe91.tar.gz
external_llvm-6611eaa32f7941dd50a3ffe608f3f4a7665dbe91.tar.bz2
SLPVectorizer: change the order in which we search for vectorization candidates. Do stores first and PHIs second.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186277 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/Vectorize/SLPVectorizer.cpp')
-rw-r--r--lib/Transforms/Vectorize/SLPVectorizer.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/Transforms/Vectorize/SLPVectorizer.cpp b/lib/Transforms/Vectorize/SLPVectorizer.cpp
index 12316b4..5449f39 100644
--- a/lib/Transforms/Vectorize/SLPVectorizer.cpp
+++ b/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<StoreInst *> 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)