summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Vectorize/VecUtils.cpp
diff options
context:
space:
mode:
authorNadav Rotem <nrotem@apple.com>2013-06-20 17:41:45 +0000
committerNadav Rotem <nrotem@apple.com>2013-06-20 17:41:45 +0000
commit14a89c5428666eac2659caa73182691e9a88bcf9 (patch)
tree35cebe5d8366e8b29e51028941cfa3adf5176a8d /llvm/lib/Transforms/Vectorize/VecUtils.cpp
parent8300e1299116ed89ae81609d453756cfeb4084d3 (diff)
downloadbcm5719-llvm-14a89c5428666eac2659caa73182691e9a88bcf9.tar.gz
bcm5719-llvm-14a89c5428666eac2659caa73182691e9a88bcf9.zip
SLPVectorization: Add a basic support for cross-basic block slp vectorization.
We collect gather sequences when we vectorize basic blocks. Gather sequences are excellent hints for vectorization of other basic blocks. llvm-svn: 184444
Diffstat (limited to 'llvm/lib/Transforms/Vectorize/VecUtils.cpp')
-rw-r--r--llvm/lib/Transforms/Vectorize/VecUtils.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/Vectorize/VecUtils.cpp b/llvm/lib/Transforms/Vectorize/VecUtils.cpp
index e79f08a56dd..88c457d1176 100644
--- a/llvm/lib/Transforms/Vectorize/VecUtils.cpp
+++ b/llvm/lib/Transforms/Vectorize/VecUtils.cpp
@@ -731,9 +731,13 @@ Value *BoUpSLP::Scalarize(ArrayRef<Value *> VL, VectorType *Ty) {
// Remember that this instruction is used as part of a 'gather' sequence.
// The caller of the bottom-up slp vectorizer can try to hoist the sequence
// if the users are outside of the basic block.
- GatherInstructions.push_back(Vec);
+ if (InsertElementInst *IEI = dyn_cast<InsertElementInst>(Vec))
+ GatherInstructions.push_back(IEI);
}
+ // Mark the end of the gather sequence.
+ GatherInstructions.push_back(0);
+
for (unsigned i = 0; i < Ty->getNumElements(); ++i)
VectorizedValues[VL[i]] = Vec;
OpenPOWER on IntegriCloud