mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-07 12:28:24 +00:00
simplify code and reduce indentation
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121670 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -168,18 +168,18 @@ bool JumpThreading::runOnFunction(Function &F) {
|
||||
LVI->eraseBlock(BB);
|
||||
DeleteDeadBlock(BB);
|
||||
Changed = true;
|
||||
} else if (BranchInst *BI = dyn_cast<BranchInst>(BB->getTerminator())) {
|
||||
continue;
|
||||
}
|
||||
|
||||
BranchInst *BI = dyn_cast<BranchInst>(BB->getTerminator());
|
||||
|
||||
// Can't thread an unconditional jump, but if the block is "almost
|
||||
// empty", we can replace uses of it with uses of the successor and make
|
||||
// this dead.
|
||||
if (BI->isUnconditional() &&
|
||||
BB != &BB->getParent()->getEntryBlock()) {
|
||||
BasicBlock::iterator BBI = BB->getFirstNonPHI();
|
||||
// Ignore dbg intrinsics.
|
||||
while (isa<DbgInfoIntrinsic>(BBI))
|
||||
++BBI;
|
||||
if (BI && BI->isUnconditional() &&
|
||||
BB != &BB->getParent()->getEntryBlock() &&
|
||||
// If the terminator is the only non-phi instruction, try to nuke it.
|
||||
if (BBI->isTerminator()) {
|
||||
BB->getFirstNonPHIOrDbg()->isTerminator()) {
|
||||
// Since TryToSimplifyUncondBranchFromEmptyBlock may delete the
|
||||
// block, we have to make sure it isn't in the LoopHeaders set. We
|
||||
// reinsert afterward if needed.
|
||||
@@ -202,8 +202,6 @@ bool JumpThreading::runOnFunction(Function &F) {
|
||||
LoopHeaders.insert(BB);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
EverChanged |= Changed;
|
||||
} while (Changed);
|
||||
|
||||
|
Reference in New Issue
Block a user