summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
diff options
context:
space:
mode:
authorNadav Rotem <nrotem@apple.com>2013-07-09 21:38:08 +0000
committerNadav Rotem <nrotem@apple.com>2013-07-09 21:38:08 +0000
commitd7b574e5b3f5b21406b5ff409bd1a90c019e5285 (patch)
tree3b367f9cdfacc71857f3c6bf6ce03f51a7491fbd /llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
parent8e1cb5adb34272aaebf06ad6595813a731c59602 (diff)
downloadbcm5719-llvm-d7b574e5b3f5b21406b5ff409bd1a90c019e5285.tar.gz
bcm5719-llvm-d7b574e5b3f5b21406b5ff409bd1a90c019e5285.zip
Fix PR16571, which is a bug in the code that checks that all of the types in the bundle are uniform.
llvm-svn: 185970
Diffstat (limited to 'llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp')
-rw-r--r--llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp b/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
index 93ff1f7e5b5..af6a07b34fa 100644
--- a/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
+++ b/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
@@ -172,7 +172,7 @@ static unsigned getSameOpcode(ArrayRef<Value *> VL) {
static Type* getSameType(ArrayRef<Value *> VL) {
Type *Ty = VL[0]->getType();
for (int i = 1, e = VL.size(); i < e; i++)
- if (VL[0]->getType() != Ty)
+ if (VL[i]->getType() != Ty)
return 0;
return Ty;
@@ -389,6 +389,8 @@ private:
void BoUpSLP::buildTree(ArrayRef<Value *> Roots) {
deleteTree();
+ if (!getSameType(Roots))
+ return;
buildTree_rec(Roots, 0);
}
OpenPOWER on IntegriCloud