diff options
Diffstat (limited to 'lib/Transforms/Vectorize/SLPVectorizer.cpp')
-rw-r--r-- | lib/Transforms/Vectorize/SLPVectorizer.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/Transforms/Vectorize/SLPVectorizer.cpp b/lib/Transforms/Vectorize/SLPVectorizer.cpp index 93ff1f7..af6a07b 100644 --- a/lib/Transforms/Vectorize/SLPVectorizer.cpp +++ b/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); } |