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 | 5f7c12cfbde275cd87c2ba33aa17d6ff6f5de436 (patch) | |
tree | 8c9f46f3de86a5ff8935f08320c8b2681d5fe0a3 /llvm/lib/Transforms/Vectorize/LoopVectorize.cpp | |
parent | 7e1599e100e2d5ee56ee38c3ace692a0e05f39d1 (diff) | |
download | bcm5719-llvm-5f7c12cfbde275cd87c2ba33aa17d6ff6f5de436.tar.gz bcm5719-llvm-5f7c12cfbde275cd87c2ba33aa17d6ff6f5de436.zip |
LoopVectorizer: When checking for vectorizable types, also check
the StoreInst operands.
PR14705.
llvm-svn: 171023
Diffstat (limited to 'llvm/lib/Transforms/Vectorize/LoopVectorize.cpp')
-rw-r--r-- | llvm/lib/Transforms/Vectorize/LoopVectorize.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp index 20bcf8681b8..d571903984c 100644 --- a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp +++ b/llvm/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)) |