mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-24 03:33:20 +01:00
[LV] Remove redundant basic block split
This patch is part of D28975's breakdown. Genreating the control-flow to guard predicated instructions modified to only use SplitBlockAndInsertIfThen() for producing the if-then construct. Differential Revision: https://reviews.llvm.org/D32224 llvm-svn: 301293
This commit is contained in:
parent
f9368247a8
commit
a2e72f19da
@ -4516,14 +4516,15 @@ void InnerLoopVectorizer::predicateInstructions() {
|
||||
for (auto KV : PredicatedInstructions) {
|
||||
BasicBlock::iterator I(KV.first);
|
||||
BasicBlock *Head = I->getParent();
|
||||
auto *BB = SplitBlock(Head, &*std::next(I), DT, LI);
|
||||
auto *T = SplitBlockAndInsertIfThen(KV.second, &*I, /*Unreachable=*/false,
|
||||
/*BranchWeights=*/nullptr, DT, LI);
|
||||
I->moveBefore(T);
|
||||
sinkScalarOperands(&*I);
|
||||
|
||||
I->getParent()->setName(Twine("pred.") + I->getOpcodeName() + ".if");
|
||||
BB->setName(Twine("pred.") + I->getOpcodeName() + ".continue");
|
||||
BasicBlock *PredicatedBlock = I->getParent();
|
||||
Twine BBNamePrefix = Twine("pred.") + I->getOpcodeName();
|
||||
PredicatedBlock->setName(BBNamePrefix + ".if");
|
||||
PredicatedBlock->getSingleSuccessor()->setName(BBNamePrefix + ".continue");
|
||||
|
||||
// If the instruction is non-void create a Phi node at reconvergence point.
|
||||
if (!I->getType()->isVoidTy()) {
|
||||
|
Loading…
Reference in New Issue
Block a user