forked from OSchip/llvm-project
[SimplifyCFG] ConstantFoldTerminator() already knows how to preserve DomTree
... so just ensure that we pass DomTreeUpdater it into it. Fixes DomTree preservation for a number of tests, all of which are marked as such so that they do not regress.
This commit is contained in:
parent
164e0847a5
commit
2ee724863e
|
@ -6322,7 +6322,8 @@ bool SimplifyCFGOpt::simplifyOnce(BasicBlock *BB) {
|
|||
|
||||
// Check to see if we can constant propagate this terminator instruction
|
||||
// away...
|
||||
Changed |= ConstantFoldTerminator(BB, true);
|
||||
Changed |= ConstantFoldTerminator(BB, /*DeleteDeadConditions=*/true,
|
||||
/*TLI=*/nullptr, DTU);
|
||||
|
||||
// Check for and eliminate duplicate PHI nodes in this block.
|
||||
Changed |= EliminateDuplicatePHINodes(BB);
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
; RUN: opt < %s -simplifycfg -disable-output
|
||||
; RUN: opt < %s -simplifycfg -simplifycfg-require-and-preserve-domtree=1 -disable-output
|
||||
|
||||
define void @symhash_add() {
|
||||
entry:
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
; RUN: opt < %s -simplifycfg -disable-output
|
||||
; RUN: opt < %s -simplifycfg -simplifycfg-require-and-preserve-domtree=1 -disable-output
|
||||
; PR 2777
|
||||
@g_103 = common global i32 0 ; <i32*> [#uses=1]
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
; RUN: opt < %s -simplifycfg -S | FileCheck %s
|
||||
; RUN: opt < %s -simplifycfg -simplifycfg-require-and-preserve-domtree=1 -S | FileCheck %s
|
||||
; PR9420
|
||||
|
||||
; Note that the crash in PR9420 test is sensitive to the ordering of
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
;; Check that we don't crash. PR37300.
|
||||
; 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() {
|
||||
; CHECK-LABEL: @patatino(
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
; RUN: opt %s -S -simplifycfg | FileCheck %s
|
||||
; RUN: opt %s -S -simplifycfg -simplifycfg-require-and-preserve-domtree=1 | FileCheck %s
|
||||
|
||||
declare void @is(i1)
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
; RUN: opt %s -S -simplifycfg | FileCheck %s
|
||||
; RUN: opt %s -S -simplifycfg -simplifycfg-require-and-preserve-domtree=1 | FileCheck %s
|
||||
|
||||
declare void @dead()
|
||||
declare void @alive()
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
; RUN: opt %s -S -simplifycfg | FileCheck %s
|
||||
; RUN: opt %s -S -simplifycfg -simplifycfg-require-and-preserve-domtree=1 | FileCheck %s
|
||||
; Check for when one branch implies the value of a successors conditional and
|
||||
; it's not simply the same conditional repeated.
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
; RUN: opt -S -simplifycfg < %s | FileCheck %s
|
||||
; RUN: opt -S -simplifycfg -simplifycfg-require-and-preserve-domtree=1 < %s | FileCheck %s
|
||||
|
||||
; SimplifyCFG should eliminate redundant indirectbr edges.
|
||||
|
||||
|
|
Loading…
Reference in New Issue