diff options
author | Arnold Schwaighofer <aschwaighofer@apple.com> | 2014-02-08 20:41:13 +0000 |
---|---|---|
committer | Arnold Schwaighofer <aschwaighofer@apple.com> | 2014-02-08 20:41:13 +0000 |
commit | 348e1b60be593b4d9627dafed61a1a01392fb62c (patch) | |
tree | 820fcfbd446335fe3c1fc97a3f44d0bf2516cc76 /llvm/lib/Transforms/Vectorize/LoopVectorize.cpp | |
parent | 3c6774a172a116adf5272081c926af54fb81d384 (diff) | |
download | bcm5719-llvm-348e1b60be593b4d9627dafed61a1a01392fb62c.tar.gz bcm5719-llvm-348e1b60be593b4d9627dafed61a1a01392fb62c.zip |
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.
llvm-svn: 201028
Diffstat (limited to 'llvm/lib/Transforms/Vectorize/LoopVectorize.cpp')
-rw-r--r-- | llvm/lib/Transforms/Vectorize/LoopVectorize.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp index 930cf7799a2..b52970119a5 100644 --- a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp +++ b/llvm/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(); |