summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Vectorize
diff options
context:
space:
mode:
authorNadav Rotem <nrotem@apple.com>2013-04-20 07:22:58 +0000
committerNadav Rotem <nrotem@apple.com>2013-04-20 07:22:58 +0000
commit998e035cae2403a929440d3a5b02838ff81a31fb (patch)
tree4bad096b954e76a701279e756a36b82f6bc78461 /llvm/lib/Transforms/Vectorize
parent890387289ef08eb8bacc56cd5e336a4c6cd55786 (diff)
downloadbcm5719-llvm-998e035cae2403a929440d3a5b02838ff81a31fb.tar.gz
bcm5719-llvm-998e035cae2403a929440d3a5b02838ff81a31fb.zip
refactor tryToVectorizePair to a new method that supports vectorization of lists.
llvm-svn: 179932
Diffstat (limited to 'llvm/lib/Transforms/Vectorize')
-rw-r--r--llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp b/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
index 40875c305b5..6f4d69e3424 100644
--- a/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
+++ b/llvm/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 <<
OpenPOWER on IntegriCloud