[llvm] r179929 - Report the number of stores that were found in the debug message.
Nadav Rotem
nrotem at apple.com
Fri Apr 19 22:23:11 PDT 2013
Author: nadav
Date: Sat Apr 20 00:23:11 2013
New Revision: 179929
URL: http://llvm.org/viewvc/llvm-project?rev=179929&view=rev
Log:
Report the number of stores that were found in the debug message.
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=179929&r1=179928&r2=179929&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Vectorize/SLPVectorizer.cpp (original)
+++ llvm/trunk/lib/Transforms/Vectorize/SLPVectorizer.cpp Sat Apr 20 00:23:11 2013
@@ -89,8 +89,8 @@ struct SLPVectorizer : public FunctionPa
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(BasicB
// 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(BasicB
// Save the store locations.
StoreRefs[Ptr].push_back(SI);
+ count++;
}
- return true;
+ return count;
}
bool SLPVectorizer::tryToVectorizePair(Value *A, Value *B, BoUpSLP &R) {
More information about the llvm-commits
mailing list