diff options
author | Benjamin Kramer <benny.kra@googlemail.com> | 2013-04-20 09:49:10 +0000 |
---|---|---|
committer | Benjamin Kramer <benny.kra@googlemail.com> | 2013-04-20 09:49:10 +0000 |
commit | 6fe5cc49d88c9dd48a1eefe4c1bdba1567b8eef2 (patch) | |
tree | 0c5e0288ab6e1b0df6ac163718f5cabfd811b736 /lib/Transforms/Vectorize/SLPVectorizer.cpp | |
parent | cd949714ebfab4b6bc54d964a337c23370aab5b2 (diff) |
SLPVectorizer: Strength reduce SmallVectors to ArrayRefs.
Avoids a couple of copies and allows more flexibility in the clients.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179935 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/Vectorize/SLPVectorizer.cpp')
-rw-r--r-- | lib/Transforms/Vectorize/SLPVectorizer.cpp | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/lib/Transforms/Vectorize/SLPVectorizer.cpp b/lib/Transforms/Vectorize/SLPVectorizer.cpp index 3a0e9abe57..207d607644 100644 --- a/lib/Transforms/Vectorize/SLPVectorizer.cpp +++ b/lib/Transforms/Vectorize/SLPVectorizer.cpp @@ -128,7 +128,7 @@ private: bool tryToVectorizePair(Value *A, Value *B, BoUpSLP &R); /// \brief Try to vectorize a list of operands. - bool tryToVectorizeList(BoUpSLP::ValueList &VL, BoUpSLP &R); + 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); @@ -174,13 +174,11 @@ unsigned SLPVectorizer::collectStores(BasicBlock *BB, BoUpSLP &R) { bool SLPVectorizer::tryToVectorizePair(Value *A, Value *B, BoUpSLP &R) { if (!A || !B) return false; - BoUpSLP::ValueList VL; - VL.push_back(A); - VL.push_back(B); + Value *VL[] = { A, B }; return tryToVectorizeList(VL, R); } -bool SLPVectorizer::tryToVectorizeList(BoUpSLP::ValueList &VL, BoUpSLP &R) { +bool SLPVectorizer::tryToVectorizeList(ArrayRef<Value *> VL, BoUpSLP &R) { DEBUG(dbgs()<<"SLP: Vectorizing a list of length = " << VL.size() << ".\n"); int Cost = R.getTreeCost(VL); int ExtrCost = R.getScalarizationCost(VL); |