From 9e5329d77e590f757dbd8384f418e44df9dbf91a Mon Sep 17 00:00:00 2001 From: Nadav Rotem Date: Mon, 24 Dec 2012 09:14:18 +0000 Subject: LoopVectorizer: When checking for vectorizable types, also check the StoreInst operands. PR14705. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171023 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Transforms/Vectorize/LoopVectorize.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'lib/Transforms/Vectorize/LoopVectorize.cpp') diff --git a/lib/Transforms/Vectorize/LoopVectorize.cpp b/lib/Transforms/Vectorize/LoopVectorize.cpp index 20bcf8681b..d571903984 100644 --- a/lib/Transforms/Vectorize/LoopVectorize.cpp +++ b/lib/Transforms/Vectorize/LoopVectorize.cpp @@ -1464,13 +1464,20 @@ bool LoopVectorizationLegality::canVectorizeInstrs() { return false; } - // We do not re-vectorize vectors. + // Check that the instruction return type is vectorizable. if (!VectorType::isValidElementType(it->getType()) && !it->getType()->isVoidTy()) { DEBUG(dbgs() << "LV: Found unvectorizable type." << "\n"); return false; } + // Check that the stored type is vectorizable. + if (StoreInst *ST = dyn_cast(it)) { + Type *T = ST->getValueOperand()->getType(); + if (!VectorType::isValidElementType(T)) + return false; + } + // Reduction instructions are allowed to have exit users. // All other instructions must not have external users. if (!AllowedExit.count(it)) -- cgit v1.2.3-18-g5258