forked from OSchip/llvm-project
[SimplifyCFG] Teach SimplifyCondBranchToTwoReturns() to preserve DomTree, part 2
... for the custom case returning void.
This commit is contained in:
parent
b94520c9ee
commit
6a1617d67c
|
@ -2631,6 +2631,10 @@ bool SimplifyCFGOpt::SimplifyCondBranchToTwoReturns(BranchInst *BI,
|
||||||
FalseSucc->removePredecessor(BB);
|
FalseSucc->removePredecessor(BB);
|
||||||
Builder.CreateRetVoid();
|
Builder.CreateRetVoid();
|
||||||
EraseTerminatorAndDCECond(BI);
|
EraseTerminatorAndDCECond(BI);
|
||||||
|
if (DTU) {
|
||||||
|
DTU->applyUpdatesPermissive({{DominatorTree::Delete, BB, TrueSucc},
|
||||||
|
{DominatorTree::Delete, BB, FalseSucc}});
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
;; Check that we don't crash. PR37300.
|
;; Check that we don't crash. PR37300.
|
||||||
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
|
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
|
||||||
; RUN: opt %s -S -simplifycfg | FileCheck %s
|
; RUN: opt %s -S -simplifycfg -simplifycfg-require-and-preserve-domtree=1 | FileCheck %s
|
||||||
|
|
||||||
define void @patatino() {
|
define void @patatino() {
|
||||||
; CHECK-LABEL: @patatino(
|
; CHECK-LABEL: @patatino(
|
||||||
|
|
Loading…
Reference in New Issue