From d7b574e5b3f5b21406b5ff409bd1a90c019e5285 Mon Sep 17 00:00:00 2001 From: Nadav Rotem Date: Tue, 9 Jul 2013 21:38:08 +0000 Subject: Fix PR16571, which is a bug in the code that checks that all of the types in the bundle are uniform. llvm-svn: 185970 --- llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp') 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 VL) { static Type* getSameType(ArrayRef 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 Roots) { deleteTree(); + if (!getSameType(Roots)) + return; buildTree_rec(Roots, 0); } -- cgit v1.2.3