summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
diff options
context:
space:
mode:
authorNadav Rotem <nrotem@apple.com>2012-12-20 20:24:40 +0000
committerNadav Rotem <nrotem@apple.com>2012-12-20 20:24:40 +0000
commit2ababf68d78be7b4dcd76a04f1becfd92b791e66 (patch)
tree8f285a2a241fed03d41576054b1638bfd2717826 /llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
parenta0b151715a4a9e038e17d95c47b0311543e46030 (diff)
downloadbcm5719-llvm-2ababf68d78be7b4dcd76a04f1becfd92b791e66.tar.gz
bcm5719-llvm-2ababf68d78be7b4dcd76a04f1becfd92b791e66.zip
LoopVectorize: Fix a bug in the scalarization of instructions.
Before if-conversion we could check if a value is loop invariant if it was declared inside the basic block. Now that loops have multiple blocks this check is incorrect. This fixes External/SPEC/CINT95/099_go/099_go llvm-svn: 170756
Diffstat (limited to 'llvm/lib/Transforms/Vectorize/LoopVectorize.cpp')
-rw-r--r--llvm/lib/Transforms/Vectorize/LoopVectorize.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
index ee544b3a7f1..827c13ffc9f 100644
--- a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
+++ b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
@@ -284,7 +284,7 @@ void InnerLoopVectorizer::scalarizeInstruction(Instruction *Instr) {
// If the src is an instruction that appeared earlier in the basic block
// then it should already be vectorized.
- if (SrcInst && SrcInst->getParent() == Instr->getParent()) {
+ if (SrcInst && OrigLoop->contains(SrcInst)) {
assert(WidenMap.count(SrcInst) && "Source operand is unavailable");
// The parameter is a vector value from earlier.
Params.push_back(WidenMap[SrcInst]);
OpenPOWER on IntegriCloud