forked from OSchip/llvm-project
[NFC][JumpThreading] Increment 'NumFolds' statistic all places terminator becomes uncond
This commit is contained in:
parent
a407738def
commit
f041757e9c
|
@ -1110,6 +1110,7 @@ bool JumpThreadingPass::processBlock(BasicBlock *BB) {
|
|||
LLVM_DEBUG(dbgs() << " In block '" << BB->getName()
|
||||
<< "' folding undef terminator: " << *BBTerm << '\n');
|
||||
BranchInst::Create(BBTerm->getSuccessor(BestSucc), BBTerm);
|
||||
++NumFolds;
|
||||
BBTerm->eraseFromParent();
|
||||
DTU->applyUpdatesPermissive(Updates);
|
||||
if (FI)
|
||||
|
@ -1165,6 +1166,7 @@ bool JumpThreadingPass::processBlock(BasicBlock *BB) {
|
|||
BranchInst *UncondBr =
|
||||
BranchInst::Create(CondBr->getSuccessor(ToKeep), CondBr);
|
||||
UncondBr->setDebugLoc(CondBr->getDebugLoc());
|
||||
++NumFolds;
|
||||
CondBr->eraseFromParent();
|
||||
if (CondCmp->use_empty())
|
||||
CondCmp->eraseFromParent();
|
||||
|
@ -1280,6 +1282,7 @@ bool JumpThreadingPass::processImpliedCondition(BasicBlock *BB) {
|
|||
RemoveSucc->removePredecessor(BB);
|
||||
BranchInst *UncondBI = BranchInst::Create(KeepSucc, BI);
|
||||
UncondBI->setDebugLoc(BI->getDebugLoc());
|
||||
++NumFolds;
|
||||
BI->eraseFromParent();
|
||||
DTU->applyUpdatesPermissive({{DominatorTree::Delete, BB, RemoveSucc}});
|
||||
if (HasProfileData)
|
||||
|
@ -1729,6 +1732,7 @@ bool JumpThreadingPass::processThreadableEdges(Value *Cond, BasicBlock *BB,
|
|||
// Finally update the terminator.
|
||||
Instruction *Term = BB->getTerminator();
|
||||
BranchInst::Create(OnlyDest, Term);
|
||||
++NumFolds;
|
||||
Term->eraseFromParent();
|
||||
DTU->applyUpdatesPermissive(Updates);
|
||||
if (HasProfileData)
|
||||
|
|
Loading…
Reference in New Issue