diff options
author | Nadav Rotem <nrotem@apple.com> | 2013-04-20 05:23:11 +0000 |
---|---|---|
committer | Nadav Rotem <nrotem@apple.com> | 2013-04-20 05:23:11 +0000 |
commit | ef332b1ca1721be962c73e76b4c4e0e44ffaf5d9 (patch) | |
tree | 69e5d5f0a0a27ed172ac9cc5f6c9451db9413028 /lib/Transforms/Vectorize/SLPVectorizer.cpp | |
parent | 2aaa269617e6cf018e73757001532db92d6a013a (diff) |
Report the number of stores that were found in the debug message.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179929 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/Vectorize/SLPVectorizer.cpp')
-rw-r--r-- | lib/Transforms/Vectorize/SLPVectorizer.cpp | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/lib/Transforms/Vectorize/SLPVectorizer.cpp b/lib/Transforms/Vectorize/SLPVectorizer.cpp index 6d4c36aacd..a9ec243bc0 100644 --- a/lib/Transforms/Vectorize/SLPVectorizer.cpp +++ b/lib/Transforms/Vectorize/SLPVectorizer.cpp @@ -89,8 +89,8 @@ struct SLPVectorizer : public FunctionPass { BBChanged |= vectorizeReductions(BB, R); // Vectorize trees that end at stores. - if (collectStores(BB, R)) { - DEBUG(dbgs()<<"SLP: Found stores to vectorize.\n"); + if (unsigned count = collectStores(BB, R)) { + DEBUG(dbgs()<<"SLP: Found " << count << " stores to vectorize.\n"); BBChanged |= vectorizeStoreChains(R); } @@ -121,7 +121,7 @@ private: /// object. We sort the stores to their base objects to reduce the cost of the /// quadratic search on the stores. TODO: We can further reduce this cost /// if we flush the chain creation every time we run into a memory barrier. - bool collectStores(BasicBlock *BB, BoUpSLP &R); + unsigned collectStores(BasicBlock *BB, BoUpSLP &R); /// \brief Try to vectorize a chain that starts at two arithmetic instrs. bool tryToVectorizePair(Value *A, Value *B, BoUpSLP &R); @@ -144,7 +144,8 @@ private: StoreListMap StoreRefs; }; -bool SLPVectorizer::collectStores(BasicBlock *BB, BoUpSLP &R) { +unsigned SLPVectorizer::collectStores(BasicBlock *BB, BoUpSLP &R) { + unsigned count = 0; StoreRefs.clear(); for (BasicBlock::iterator it = BB->begin(), e = BB->end(); it != e; ++it) { StoreInst *SI = dyn_cast<StoreInst>(it); @@ -153,7 +154,7 @@ bool SLPVectorizer::collectStores(BasicBlock *BB, BoUpSLP &R) { // Check that the pointer points to scalars. if (SI->getValueOperand()->getType()->isAggregateType()) - return false; + return 0; // Find the base of the GEP. Value *Ptr = SI->getPointerOperand(); @@ -162,8 +163,9 @@ bool SLPVectorizer::collectStores(BasicBlock *BB, BoUpSLP &R) { // Save the store locations. StoreRefs[Ptr].push_back(SI); + count++; } - return true; + return count; } bool SLPVectorizer::tryToVectorizePair(Value *A, Value *B, BoUpSLP &R) { |