summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorArnold Schwaighofer <aschwaighofer@apple.com>2014-02-08 20:41:13 +0000
committerArnold Schwaighofer <aschwaighofer@apple.com>2014-02-08 20:41:13 +0000
commit846acbeef17fd6df7f389c034ada5c490d006d76 (patch)
tree41f869d9a5d579d62cb60a14b7afc6af3f754a2c /lib
parente09411dd68534824b0a79749da44589983061d07 (diff)
downloadllvm-846acbeef17fd6df7f389c034ada5c490d006d76.tar.gz
llvm-846acbeef17fd6df7f389c034ada5c490d006d76.tar.bz2
llvm-846acbeef17fd6df7f389c034ada5c490d006d76.tar.xz
LoopVectorizer: Keep track of conditional store basic blocks
Before conditional store vectorization/unrolling we had only one vectorized/unrolled basic block. After adding support for conditional store vectorization this will not only be one block but multiple basic blocks. The last block would have the back-edge. I updated the code to use a vector of basic blocks instead of a single basic block and fixed the users to use the last entry in this vector. But, I forgot to add the basic blocks to this vector! Fixes PR18724. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@201028 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/Transforms/Vectorize/LoopVectorize.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/Transforms/Vectorize/LoopVectorize.cpp b/lib/Transforms/Vectorize/LoopVectorize.cpp
index 930cf7799a..b52970119a 100644
--- a/lib/Transforms/Vectorize/LoopVectorize.cpp
+++ b/lib/Transforms/Vectorize/LoopVectorize.cpp
@@ -1640,6 +1640,7 @@ void InnerLoopVectorizer::scalarizeInstruction(Instruction *Instr, bool IfPredic
Cmp = Builder.CreateExtractElement(Cond[Part], Builder.getInt32(Width));
Cmp = Builder.CreateICmp(ICmpInst::ICMP_EQ, Cmp, ConstantInt::get(Cmp->getType(), 1));
CondBlock = IfBlock->splitBasicBlock(InsertPt, "cond.store");
+ LoopVectorBody.push_back(CondBlock);
VectorLp->addBasicBlockToLoop(CondBlock, LI->getBase());
// Update Builder with newly created basic block.
Builder.SetInsertPoint(InsertPt);
@@ -1668,6 +1669,7 @@ void InnerLoopVectorizer::scalarizeInstruction(Instruction *Instr, bool IfPredic
// End if-block.
if (IfPredicateStore) {
BasicBlock *NewIfBlock = CondBlock->splitBasicBlock(InsertPt, "else");
+ LoopVectorBody.push_back(NewIfBlock);
VectorLp->addBasicBlockToLoop(NewIfBlock, LI->getBase());
Builder.SetInsertPoint(InsertPt);
Instruction *OldBr = IfBlock->getTerminator();
@@ -5736,6 +5738,7 @@ void InnerLoopUnroller::scalarizeInstruction(Instruction *Instr,
Cmp = Builder.CreateICmp(ICmpInst::ICMP_EQ, Cond[Part],
ConstantInt::get(Cond[Part]->getType(), 1));
CondBlock = IfBlock->splitBasicBlock(InsertPt, "cond.store");
+ LoopVectorBody.push_back(CondBlock);
VectorLp->addBasicBlockToLoop(CondBlock, LI->getBase());
// Update Builder with newly created basic block.
Builder.SetInsertPoint(InsertPt);
@@ -5761,6 +5764,7 @@ void InnerLoopUnroller::scalarizeInstruction(Instruction *Instr,
// End if-block.
if (IfPredicateStore) {
BasicBlock *NewIfBlock = CondBlock->splitBasicBlock(InsertPt, "else");
+ LoopVectorBody.push_back(NewIfBlock);
VectorLp->addBasicBlockToLoop(NewIfBlock, LI->getBase());
Builder.SetInsertPoint(InsertPt);
Instruction *OldBr = IfBlock->getTerminator();