diff options
author | Nadav Rotem <nrotem@apple.com> | 2012-12-24 09:14:18 +0000 |
---|---|---|
committer | Nadav Rotem <nrotem@apple.com> | 2012-12-24 09:14:18 +0000 |
commit | 9e5329d77e590f757dbd8384f418e44df9dbf91a (patch) | |
tree | 8cd0fca3d64aba63a8542b029b5986d41e7eb801 /lib/Transforms | |
parent | daf7b5c8f2889ddb923544565f07518d504aa574 (diff) |
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
Diffstat (limited to 'lib/Transforms')
-rw-r--r-- | lib/Transforms/Vectorize/LoopVectorize.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
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<StoreInst>(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)) |