From d6f0c34273dd3536102f2d643403252468dfc4a3 Mon Sep 17 00:00:00 2001 From: Nadav Rotem Date: Thu, 11 Jul 2013 20:56:13 +0000 Subject: [PATCH] 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 --- lib/Transforms/Vectorize/SLPVectorizer.cpp | 27 ++++++++++------------ 1 file changed, 12 insertions(+), 15 deletions(-) diff --git a/lib/Transforms/Vectorize/SLPVectorizer.cpp b/lib/Transforms/Vectorize/SLPVectorizer.cpp index 751ed1abf2e..7b9be652d44 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 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 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 VL, BoUpSLP &R, bool NeedExtracts); + bool tryToVectorizeList(ArrayRef 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 VL, BoUpSLP &R, - bool NeedExtracts) { +bool SLPVectorizer::tryToVectorizeList(ArrayRef VL, BoUpSLP &R) { if (VL.size() < 2) return false; @@ -1742,12 +1741,10 @@ bool SLPVectorizer::tryToVectorizeList(ArrayRef 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;