diff --git a/llvm/lib/Transforms/Utils/SimplifyCFG.cpp b/llvm/lib/Transforms/Utils/SimplifyCFG.cpp index f39ab25ee64abe..9e4650fefff74d 100644 --- a/llvm/lib/Transforms/Utils/SimplifyCFG.cpp +++ b/llvm/lib/Transforms/Utils/SimplifyCFG.cpp @@ -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); diff --git a/llvm/test/Transforms/SimplifyCFG/2004-12-10-SimplifyCFGCrash.ll b/llvm/test/Transforms/SimplifyCFG/2004-12-10-SimplifyCFGCrash.ll index fafe73b2b4efee..69803400a683c0 100644 --- a/llvm/test/Transforms/SimplifyCFG/2004-12-10-SimplifyCFGCrash.ll +++ b/llvm/test/Transforms/SimplifyCFG/2004-12-10-SimplifyCFGCrash.ll @@ -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: diff --git a/llvm/test/Transforms/SimplifyCFG/2008-09-08-MultiplePred.ll b/llvm/test/Transforms/SimplifyCFG/2008-09-08-MultiplePred.ll index 6b216f598efb5c..a2477f2f3a6639 100644 --- a/llvm/test/Transforms/SimplifyCFG/2008-09-08-MultiplePred.ll +++ b/llvm/test/Transforms/SimplifyCFG/2008-09-08-MultiplePred.ll @@ -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 ; [#uses=1] diff --git a/llvm/test/Transforms/SimplifyCFG/2011-03-08-UnreachableUse.ll b/llvm/test/Transforms/SimplifyCFG/2011-03-08-UnreachableUse.ll index 329774e22429c6..772912c645b3c3 100644 --- a/llvm/test/Transforms/SimplifyCFG/2011-03-08-UnreachableUse.ll +++ b/llvm/test/Transforms/SimplifyCFG/2011-03-08-UnreachableUse.ll @@ -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 diff --git a/llvm/test/Transforms/SimplifyCFG/fold-debug-info.ll b/llvm/test/Transforms/SimplifyCFG/fold-debug-info.ll index bc5a93745375fd..bf3a283cf94119 100644 --- a/llvm/test/Transforms/SimplifyCFG/fold-debug-info.ll +++ b/llvm/test/Transforms/SimplifyCFG/fold-debug-info.ll @@ -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( diff --git a/llvm/test/Transforms/SimplifyCFG/implied-cond-matching-false-dest.ll b/llvm/test/Transforms/SimplifyCFG/implied-cond-matching-false-dest.ll index 1d29813ecfa2e5..1ad2e88bfd4ac5 100644 --- a/llvm/test/Transforms/SimplifyCFG/implied-cond-matching-false-dest.ll +++ b/llvm/test/Transforms/SimplifyCFG/implied-cond-matching-false-dest.ll @@ -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) diff --git a/llvm/test/Transforms/SimplifyCFG/implied-cond-matching.ll b/llvm/test/Transforms/SimplifyCFG/implied-cond-matching.ll index 33fc016bd38623..5b1cb821042ac1 100644 --- a/llvm/test/Transforms/SimplifyCFG/implied-cond-matching.ll +++ b/llvm/test/Transforms/SimplifyCFG/implied-cond-matching.ll @@ -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() diff --git a/llvm/test/Transforms/SimplifyCFG/implied-cond.ll b/llvm/test/Transforms/SimplifyCFG/implied-cond.ll index 317adc4c3472e1..dae7ad85d0fdc0 100644 --- a/llvm/test/Transforms/SimplifyCFG/implied-cond.ll +++ b/llvm/test/Transforms/SimplifyCFG/implied-cond.ll @@ -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. diff --git a/llvm/test/Transforms/SimplifyCFG/indirectbr.ll b/llvm/test/Transforms/SimplifyCFG/indirectbr.ll index 67e23d2fe93506..52ef6b77166c53 100644 --- a/llvm/test/Transforms/SimplifyCFG/indirectbr.ll +++ b/llvm/test/Transforms/SimplifyCFG/indirectbr.ll @@ -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.