diff options
author | Nadav Rotem <nrotem@apple.com> | 2013-04-20 07:22:58 +0000 |
---|---|---|
committer | Nadav Rotem <nrotem@apple.com> | 2013-04-20 07:22:58 +0000 |
commit | 444e33e8987110c6669bc2d9b8efd768bb17faa1 (patch) | |
tree | 1dfb08c637a0573164a2f2927e544285f544e99a | |
parent | d7e8cce287616c1cc4dcbab6a43328b01fbe7be4 (diff) |
refactor tryToVectorizePair to a new method that supports vectorization of lists.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179932 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/Transforms/Vectorize/SLPVectorizer.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/Transforms/Vectorize/SLPVectorizer.cpp b/lib/Transforms/Vectorize/SLPVectorizer.cpp index 40875c305b..6f4d69e342 100644 --- a/lib/Transforms/Vectorize/SLPVectorizer.cpp +++ b/lib/Transforms/Vectorize/SLPVectorizer.cpp @@ -127,6 +127,9 @@ private: /// \brief Try to vectorize a chain that starts at two arithmetic instrs. bool tryToVectorizePair(Value *A, Value *B, BoUpSLP &R); + /// \brief Try to vectorize a list of operands. + bool tryToVectorizeList(BoUpSLP::ValueList &VL, BoUpSLP &R); + /// \brief Try to vectorize a chain that may start at the operands of \V; bool tryToVectorize(BinaryOperator *V, BoUpSLP &R); @@ -174,6 +177,11 @@ bool SLPVectorizer::tryToVectorizePair(Value *A, Value *B, BoUpSLP &R) { BoUpSLP::ValueList VL; VL.push_back(A); VL.push_back(B); + return tryToVectorizeList(VL, R); +} + +bool SLPVectorizer::tryToVectorizeList(BoUpSLP::ValueList &VL, BoUpSLP &R) { + DEBUG(dbgs()<<"SLP: Vectorizing a list of length = " << VL.size() << ".\n"); int Cost = R.getTreeCost(VL); int ExtrCost = R.getScalarizationCost(VL); DEBUG(dbgs()<<"SLP: Cost of pair:" << Cost << |