mirror of
https://github.com/RPCSX/llvm.git
synced 2025-02-26 07:56:43 +00:00
[LoopSimplify] Reuse changeToUnreachable
Use existing functionality provided in changeToUnreachable instead of reinventing it in LoopSimplify. No functionality change is intended. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258663 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
846ffdada2
commit
de2bf5828a
@ -489,14 +489,9 @@ ReprocessLoop:
|
||||
DEBUG(dbgs() << "LoopSimplify: Deleting edge from dead predecessor "
|
||||
<< P->getName() << "\n");
|
||||
|
||||
// Inform each successor of each dead pred.
|
||||
for (succ_iterator SI = succ_begin(P), SE = succ_end(P); SI != SE; ++SI)
|
||||
(*SI)->removePredecessor(P);
|
||||
// Zap the dead pred's terminator and replace it with unreachable.
|
||||
TerminatorInst *TI = P->getTerminator();
|
||||
TI->replaceAllUsesWith(UndefValue::get(TI->getType()));
|
||||
P->getTerminator()->eraseFromParent();
|
||||
new UnreachableInst(P->getContext(), P);
|
||||
changeToUnreachable(TI, /*UseLLVMTrap=*/false);
|
||||
Changed = true;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user