diff options
author | Nadav Rotem <nrotem@apple.com> | 2013-07-11 20:56:13 +0000 |
---|---|---|
committer | Nadav Rotem <nrotem@apple.com> | 2013-07-11 20:56:13 +0000 |
commit | d6f0c34273dd3536102f2d643403252468dfc4a3 (patch) | |
tree | 31bcffcd59af27620a0bcbc704541d575e741221 /lib/Transforms | |
parent | 4d5b0da81b8126eb612085e17b3b55c007056580 (diff) | |
download | external_llvm-d6f0c34273dd3536102f2d643403252468dfc4a3.zip external_llvm-d6f0c34273dd3536102f2d643403252468dfc4a3.tar.gz external_llvm-d6f0c34273dd3536102f2d643403252468dfc4a3.tar.bz2 |
Remove an argument that we dont use anymore.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186116 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms')
-rw-r--r-- | lib/Transforms/Vectorize/SLPVectorizer.cpp | 27 |
1 files changed, 12 insertions, 15 deletions
diff --git a/lib/Transforms/Vectorize/SLPVectorizer.cpp b/lib/Transforms/Vectorize/SLPVectorizer.cpp index 751ed1a..7b9be65 100644 --- a/lib/Transforms/Vectorize/SLPVectorizer.cpp +++ b/lib/Transforms/Vectorize/SLPVectorizer.cpp @@ -250,11 +250,6 @@ public: MemBarrierIgnoreList.clear(); } - /// \returns the scalarization cost for this list of values. Assuming that - /// this subtree gets vectorized, we may need to extract the values from the - /// roots. This method calculates the cost of extracting the values. - int getGatherCost(ArrayRef<Value *> VL); - /// \returns true if the memory operations A and B are consecutive. bool isConsecutiveAccess(Value *A, Value *B); @@ -287,6 +282,11 @@ private: /// context means the creation of vectors from a group of scalars. int getGatherCost(Type *Ty); + /// \returns the scalarization cost for this list of values. Assuming that + /// this subtree gets vectorized, we may need to extract the values from the + /// roots. This method calculates the cost of extracting the values. + int getGatherCost(ArrayRef<Value *> VL); + /// \returns the AA location that is being access by the instruction. AliasAnalysis::Location getLocation(Instruction *I); @@ -1553,7 +1553,7 @@ private: /// \brief Try to vectorize a list of operands. If \p NeedExtracts is true /// then we calculate the cost of extracting the scalars from the vector. /// \returns true if a value was vectorized. - bool tryToVectorizeList(ArrayRef<Value *> VL, BoUpSLP &R, bool NeedExtracts); + bool tryToVectorizeList(ArrayRef<Value *> VL, BoUpSLP &R); /// \brief Try to vectorize a chain that may start at the operands of \V; bool tryToVectorize(BinaryOperator *V, BoUpSLP &R); @@ -1713,11 +1713,10 @@ bool SLPVectorizer::tryToVectorizePair(Value *A, Value *B, BoUpSLP &R) { if (!A || !B) return false; Value *VL[] = { A, B }; - return tryToVectorizeList(VL, R, true); + return tryToVectorizeList(VL, R); } -bool SLPVectorizer::tryToVectorizeList(ArrayRef<Value *> VL, BoUpSLP &R, - bool NeedExtracts) { +bool SLPVectorizer::tryToVectorizeList(ArrayRef<Value *> VL, BoUpSLP &R) { if (VL.size() < 2) return false; @@ -1742,12 +1741,10 @@ bool SLPVectorizer::tryToVectorizeList(ArrayRef<Value *> VL, BoUpSLP &R, R.buildTree(VL); int Cost = R.getTreeCost(); - int ExtrCost = NeedExtracts ? R.getGatherCost(VL) : 0; - DEBUG(dbgs() << "SLP: Cost of pair:" << Cost - << " Cost of extract:" << ExtrCost << ".\n"); - if ((Cost + ExtrCost) >= -SLPCostThreshold) + if (Cost >= -SLPCostThreshold) return false; - DEBUG(dbgs() << "SLP: Vectorizing pair.\n"); + + DEBUG(dbgs() << "SLP: Vectorizing pair at cost:" << Cost << ".\n"); R.vectorizeTree(); return true; } @@ -1854,7 +1851,7 @@ bool SLPVectorizer::vectorizeChainsInBlock(BasicBlock *BB, BoUpSLP &R) { } if (Incoming.size() > 1) - Changed |= tryToVectorizeList(Incoming, R, true); + Changed |= tryToVectorizeList(Incoming, R); } return Changed; |