diff options
author | Nadav Rotem <nrotem@apple.com> | 2013-04-20 22:29:43 +0000 |
---|---|---|
committer | Nadav Rotem <nrotem@apple.com> | 2013-04-20 22:29:43 +0000 |
commit | 8aca44a6234dfefd8cb340c43d7923dfaece82c1 (patch) | |
tree | c78d60fd3f69b9edecff7b8ad7911746926561b2 /llvm/lib/Transforms/Vectorize | |
parent | 51fe3a48aa01ef0506134b2614e514aeba8eb1f5 (diff) | |
download | bcm5719-llvm-8aca44a6234dfefd8cb340c43d7923dfaece82c1.tar.gz bcm5719-llvm-8aca44a6234dfefd8cb340c43d7923dfaece82c1.zip |
Fix PR15800. Do not try to vectorize vectors and structs.
llvm-svn: 179960
Diffstat (limited to 'llvm/lib/Transforms/Vectorize')
-rw-r--r-- | llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp b/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp index 207d607644f..9a4784f420d 100644 --- a/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp +++ b/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp @@ -157,7 +157,8 @@ unsigned SLPVectorizer::collectStores(BasicBlock *BB, BoUpSLP &R) { continue; // Check that the pointer points to scalars. - if (SI->getValueOperand()->getType()->isAggregateType()) + Type *Ty = SI->getValueOperand()->getType(); + if (Ty->isAggregateType() || Ty->isVectorTy()) return 0; // Find the base of the GEP. @@ -180,6 +181,14 @@ bool SLPVectorizer::tryToVectorizePair(Value *A, Value *B, BoUpSLP &R) { bool SLPVectorizer::tryToVectorizeList(ArrayRef<Value *> VL, BoUpSLP &R) { DEBUG(dbgs()<<"SLP: Vectorizing a list of length = " << VL.size() << ".\n"); + + // Check that all of the parts are scalar. + for (int i = 0, e = VL.size(); i < e; ++i) { + Type *Ty = VL[i]->getType(); + if (Ty->isAggregateType() || Ty->isVectorTy()) + return 0; + } + int Cost = R.getTreeCost(VL); int ExtrCost = R.getScalarizationCost(VL); DEBUG(dbgs()<<"SLP: Cost of pair:" << Cost << |