mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-22 18:54:02 +01:00
[NFCI][SimplifyCFG] simplifyUnreachable(): Use poison constant to represent the result of unreachable instrs
Mimics similar change for InstCombine: ce192ced2b901be67444c481ab5ca0d731e6d982 / D104602 All these uses are in blocks that aren't reachable from function's entry, and said blocks are removed by SimplifyCFG itself, so we can't really test this change.
This commit is contained in:
parent
b9347e6b66
commit
56d41a008d
@ -4700,8 +4700,7 @@ bool SimplifyCFGOpt::simplifyUnreachable(UnreachableInst *UI) {
|
||||
}
|
||||
|
||||
// Delete this instruction (any uses are guaranteed to be dead)
|
||||
if (!BBI->use_empty())
|
||||
BBI->replaceAllUsesWith(UndefValue::get(BBI->getType()));
|
||||
BBI->replaceAllUsesWith(PoisonValue::get(BBI->getType()));
|
||||
BBI->eraseFromParent();
|
||||
Changed = true;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user