[NFCI][SimplifyCFG] Mark all the SimplifyCFG tests that already don't invalidate DomTree as such

First step after e113317958,
in these tests, DomTree is valid afterwards, so mark them as such,
so that they don't regress.

In further steps, SimplifyCFG transforms shall taught to preserve DomTree,
in as small steps as possible.
This commit is contained in:
Roman Lebedev 2020-12-16 21:26:43 +03:00
parent 1bd928e50b
commit aa2009fe78
No known key found for this signature in database
GPG Key ID: 083C3EBB4A1689E0
47 changed files with 48 additions and 48 deletions

View File

@ -1,7 +1,7 @@
; These tests have an infinite trip count. We obviously shouldn't remove the
; These tests have an infinite trip count. We obviously shouldn't remove the
; loops! :)
;
; RUN: opt < %s -indvars -adce -simplifycfg -S | FileCheck %s
; RUN: opt < %s -indvars -adce -simplifycfg -simplifycfg-require-and-preserve-domtree=1 -S | FileCheck %s
;; test for (i = 1; i != 100; i += 2)
define i32 @infinite_linear() {

View File

@ -1,4 +1,4 @@
; RUN: opt < %s -jump-threading -mem2reg -instcombine -simplifycfg -S | FileCheck %s
; RUN: opt < %s -jump-threading -mem2reg -instcombine -simplifycfg -simplifycfg-require-and-preserve-domtree=1 -S | FileCheck %s
declare i32 @f1()
declare i32 @f2()

View File

@ -1,4 +1,4 @@
; RUN: opt < %s -jump-threading -mem2reg -instcombine -simplifycfg -S | FileCheck %s
; RUN: opt < %s -jump-threading -mem2reg -instcombine -simplifycfg -simplifycfg-require-and-preserve-domtree=1 -S | FileCheck %s
declare i32 @f1()
declare i32 @f2()

View File

@ -1,4 +1,4 @@
; RUN: opt -S -indvars -loop-idiom -verify -loop-simplifycfg -loop-idiom < %s | FileCheck %s
; RUN: opt -S -indvars -loop-idiom -verify -loop-simplifycfg -simplifycfg-require-and-preserve-domtree=1 -loop-idiom < %s | FileCheck %s
target triple = "x86_64-unknown-linux-gnu"

View File

@ -1,4 +1,4 @@
; RUN: opt < %s -S -loop-unroll -simplifycfg | FileCheck %s
; RUN: opt < %s -S -loop-unroll -simplifycfg -simplifycfg-require-and-preserve-domtree=1 | FileCheck %s
; PR12513: Loop unrolling breaks with indirect branches.
; If loop unrolling attempts to transform this loop, it replaces the
; indirectbr successors. SimplifyCFG then considers them to be unreachable.

View File

@ -1,4 +1,4 @@
; RUN: opt -S -mtriple=amdgcn-unknown-amdhsa -mcpu=gfx900 -loop-vectorize -simplifycfg < %s | FileCheck -check-prefixes=GCN %s
; RUN: opt -S -mtriple=amdgcn-unknown-amdhsa -mcpu=gfx900 -loop-vectorize -simplifycfg -simplifycfg-require-and-preserve-domtree=1 < %s | FileCheck -check-prefixes=GCN %s
; RUN: opt -S -mtriple=amdgcn-unknown-amdhsa -mcpu=gfx900 -loop-vectorize -pass-remarks-analysis='loop-vectorize' < %s 2>&1 | FileCheck -check-prefixes=REMARK %s
; GCN-LABEL: @runtime_check_divergent_target(

View File

@ -1,6 +1,6 @@
; Do not remove the invoke!
;
; RUN: opt < %s -simplifycfg -disable-output
; RUN: opt < %s -simplifycfg -simplifycfg-require-and-preserve-domtree=1 -disable-output
define i32 @test() personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) {
%A = invoke i32 @test( )

View File

@ -1,7 +1,7 @@
; This test checks to make sure that 'br X, Dest, Dest' is folded into
; 'br Dest'
; RUN: opt < %s -simplifycfg -S | FileCheck %s
; RUN: opt < %s -simplifycfg -simplifycfg-require-and-preserve-domtree=1 -S | FileCheck %s
declare void @noop()

View File

@ -1,4 +1,4 @@
; RUN: opt < %s -simplifycfg -S | FileCheck %s
; RUN: opt < %s -simplifycfg -simplifycfg-require-and-preserve-domtree=1 -S | FileCheck %s
; CHECK-NOT: switch
%llvm.dbg.anchor.type = type { i32, i32 }

View File

@ -1,6 +1,6 @@
; Make sure this doesn't turn into an infinite loop
; RUN: opt < %s -simplifycfg -instsimplify -simplifycfg | llvm-dis | FileCheck %s
; RUN: opt < %s -simplifycfg -simplifycfg-require-and-preserve-domtree=1 -instsimplify -simplifycfg -simplifycfg-require-and-preserve-domtree=1 | llvm-dis | FileCheck %s
%struct.anon = type { i32, i32, i32, i32, [1024 x i8] }
@_zero_ = external global %struct.anon* ; <%struct.anon**> [#uses=2]

View File

@ -1,5 +1,5 @@
; PR957
; RUN: opt < %s -simplifycfg -S | FileCheck %s
; RUN: opt < %s -simplifycfg -simplifycfg-require-and-preserve-domtree=1 -S | FileCheck %s
; CHECK-NOT: select

View File

@ -1,5 +1,5 @@
; The phi should not be eliminated in this case, because the divide op could trap.
; RUN: opt < %s -simplifycfg -S | FileCheck %s
; RUN: opt < %s -simplifycfg -simplifycfg-require-and-preserve-domtree=1 -S | FileCheck %s
target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128"
target triple = "i686-apple-darwin8"

View File

@ -1,4 +1,4 @@
; RUN: opt < %s -mtriple=aarch64-linux-gnu -simplifycfg -hoist-common-insts=true -enable-unsafe-fp-math -S >%t
; RUN: opt < %s -mtriple=aarch64-linux-gnu -simplifycfg -simplifycfg-require-and-preserve-domtree=1 -hoist-common-insts=true -enable-unsafe-fp-math -S >%t
; RUN: FileCheck %s < %t
; ModuleID = 't.cc'

View File

@ -1,6 +1,6 @@
; Basic block #2 should not be merged into BB #3!
;
; RUN: opt < %s -simplifycfg -S | FileCheck %s
; RUN: opt < %s -simplifycfg -simplifycfg-require-and-preserve-domtree=1 -S | FileCheck %s
declare void @foo()

View File

@ -1,4 +1,4 @@
; RUN: opt < %s -simplifycfg -S | \
; RUN: opt < %s -simplifycfg -simplifycfg-require-and-preserve-domtree=1 -S | \
; RUN: not grep select
;; The PHI node in this example should not be turned into a select, as we are

View File

@ -1,5 +1,5 @@
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
; RUN: opt < %s -mtriple=powerpc64le-unknown-linux-gnu -simplifycfg -hoist-common-insts=true -enable-unsafe-fp-math -S | \
; RUN: opt < %s -mtriple=powerpc64le-unknown-linux-gnu -simplifycfg -simplifycfg-require-and-preserve-domtree=1 -hoist-common-insts=true -enable-unsafe-fp-math -S | \
; RUN: FileCheck %s
; This case is copied from test/Transforms/SimplifyCFG/AArch64/

View File

@ -1,4 +1,4 @@
; RUN: opt < %s -mtriple=powerpc64le-unknown-linux-gnu -simplifycfg -hoist-common-insts=true -S | FileCheck %s
; RUN: opt < %s -mtriple=powerpc64le-unknown-linux-gnu -simplifycfg -simplifycfg-require-and-preserve-domtree=1 -hoist-common-insts=true -S | FileCheck %s
define float @foo(float* %src, float* %dest, i32 signext %count, i32 signext %cond) {
; CHECK-LABEL: @foo(

View File

@ -1,4 +1,4 @@
; RUN: opt < %s -simplifycfg -S -mtriple=sparc-unknown-unknown | FileCheck %s
; RUN: opt < %s -simplifycfg -simplifycfg-require-and-preserve-domtree=1 -S -mtriple=sparc-unknown-unknown | FileCheck %s
; Check that switches are not turned into lookup tables, as this is not
; considered profitable on the target.

View File

@ -1,4 +1,4 @@
; RUN: opt -simplifycfg -S < %s | FileCheck %s
; RUN: opt -simplifycfg -simplifycfg-require-and-preserve-domtree=1 -S < %s | FileCheck %s
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

View File

@ -1,5 +1,5 @@
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
; RUN: opt -simplifycfg -mtriple=x86_64-unknown-unknown < %s -simplifycfg-merge-cond-stores=true -simplifycfg-merge-cond-stores-aggressively=false -phi-node-folding-threshold=2 -S | FileCheck %s
; RUN: opt -simplifycfg -simplifycfg-require-and-preserve-domtree=1 -mtriple=x86_64-unknown-unknown < %s -simplifycfg-merge-cond-stores=true -simplifycfg-merge-cond-stores-aggressively=false -phi-node-folding-threshold=2 -S | FileCheck %s
define void @test_costly(i32* %p, i32 %a, i32 %b, i32 %c, i32 %d) {
; CHECK-LABEL: @test_costly(

View File

@ -1,4 +1,4 @@
; RUN: opt -simplifycfg -S < %s | FileCheck %s
; RUN: opt -simplifycfg -simplifycfg-require-and-preserve-domtree=1 -S < %s | FileCheck %s
define void @test1() {
call void @llvm.assume(i1 0)

View File

@ -1,4 +1,4 @@
; RUN: opt < %s -simplifycfg -S | FileCheck %s
; RUN: opt < %s -simplifycfg -simplifycfg-require-and-preserve-domtree=1 -S | FileCheck %s
; This test checks that the SimplifyCFG pass won't duplicate a call to a
; function marked noduplicate.

View File

@ -1,5 +1,5 @@
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
; RUN: opt < %s -simplifycfg -S | FileCheck %s
; RUN: opt < %s -simplifycfg -simplifycfg-require-and-preserve-domtree=1 -S | FileCheck %s
; s >= t, s != t, s <= t
define void @foo1(i32 %s, i32 %t) {

View File

@ -1,4 +1,4 @@
; RUN: opt < %s -simplifycfg -disable-output
; RUN: opt < %s -simplifycfg -simplifycfg-require-and-preserve-domtree=1 -disable-output
;
; Test that SimplifyCFG does not cause CallBr instructions to have duplicate
; destinations, which will cause the verifier to assert.

View File

@ -1,5 +1,5 @@
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
; RUN: opt -S -simplifycfg < %s | FileCheck %s
; RUN: opt -S -simplifycfg -simplifycfg-require-and-preserve-domtree=1 < %s | FileCheck %s
; RUN: opt -S -passes=simplify-cfg < %s | FileCheck %s
declare void @foo() convergent

View File

@ -1,4 +1,4 @@
; RUN: opt -simplifycfg -S < %s | FileCheck %s
; RUN: opt -simplifycfg -simplifycfg-require-and-preserve-domtree=1 -S < %s | FileCheck %s
; We could hoist the div/rem in these tests because it's safe to do so.
; PR31028 - https://bugs.llvm.org/show_bug.cgi?id=31028

View File

@ -1,4 +1,4 @@
; RUN: opt < %s -instcombine -simplifycfg -S | grep " = phi " | count 1
; RUN: opt < %s -instcombine -simplifycfg -simplifycfg-require-and-preserve-domtree=1 -S | grep " = phi " | count 1
; instcombine should sort the PHI operands so that simplifycfg can see the
; duplicate and remove it.

View File

@ -1,5 +1,5 @@
; 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
target datalayout = "e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64"
target triple = "thumbv7m-none--eabi"

View File

@ -1,4 +1,4 @@
; RUN: opt -simplifycfg -S < %s | FileCheck %s
; RUN: opt -simplifycfg -simplifycfg-require-and-preserve-domtree=1 -S < %s | FileCheck %s
define i32 @foo(i32 %i) nounwind ssp !dbg !0 {
call void @llvm.dbg.value(metadata i32 %i, metadata !6, metadata !DIExpression()), !dbg !7

View File

@ -1,4 +1,4 @@
; RUN: opt < %s -mem2reg -simplifycfg -S | FileCheck -enable-var-scope %s
; RUN: opt < %s -mem2reg -simplifycfg -simplifycfg-require-and-preserve-domtree=1 -S | FileCheck -enable-var-scope %s
define i32 @test(i32 %x) {
; CHECK-LABEL: @test

View File

@ -1,4 +1,4 @@
; RUN: opt < %s -simplifycfg -S | FileCheck %s
; RUN: opt < %s -simplifycfg -simplifycfg-require-and-preserve-domtree=1 -S | FileCheck %s
; Test that a lifetime intrinsic isn't removed because that would change semantics

View File

@ -1,4 +1,4 @@
; RUN: opt -simplifycfg -S < %s | FileCheck %s
; RUN: opt -simplifycfg -simplifycfg-require-and-preserve-domtree=1 -S < %s | FileCheck %s
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

View File

@ -1,4 +1,4 @@
; RUN: opt < %s -simplifycfg -S | FileCheck %s
; RUN: opt < %s -simplifycfg -simplifycfg-require-and-preserve-domtree=1 -S | FileCheck %s
; PR1796
declare void @Finisher(i32) noreturn

View File

@ -1,4 +1,4 @@
; RUN: opt < %s -simplifycfg -S | FileCheck %s
; RUN: opt < %s -simplifycfg -simplifycfg-require-and-preserve-domtree=1 -S | FileCheck %s
; Skip simplifying unconditional branches from empty blocks in simplifyCFG,
; when it can destroy canonical loop structure.

View File

@ -1,5 +1,5 @@
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
; RUN: opt -simplifycfg -S %s | FileCheck %s
; RUN: opt -simplifycfg -simplifycfg-require-and-preserve-domtree=1 -S %s | FileCheck %s
%foo = type { i32 (%foo)*, i32 }

View File

@ -1,4 +1,4 @@
; RUN: opt < %s -simplifycfg -hoist-common-insts=true -S | FileCheck %s
; RUN: opt < %s -simplifycfg -simplifycfg-require-and-preserve-domtree=1 -hoist-common-insts=true -S | FileCheck %s
declare void @bar(i32*)
declare void @baz(i32*)

View File

@ -1,4 +1,4 @@
; RUN: opt < %s -simplifycfg -hoist-common-insts=true -S | FileCheck %s
; RUN: opt < %s -simplifycfg -simplifycfg-require-and-preserve-domtree=1 -hoist-common-insts=true -S | FileCheck %s
declare void @bar(i32*)
declare void @baz(i32*)

View File

@ -1,4 +1,4 @@
; RUN: opt < %s -simplifycfg -hoist-common-insts=true -S | FileCheck %s
; RUN: opt < %s -simplifycfg -simplifycfg-require-and-preserve-domtree=1 -hoist-common-insts=true -S | FileCheck %s
declare void @bar(i32*)
declare void @baz(i32*)

View File

@ -1,4 +1,4 @@
; RUN: opt %s -simplifycfg -S | FileCheck %s
; RUN: opt %s -simplifycfg -simplifycfg-require-and-preserve-domtree=1 -S | FileCheck %s
; ConstantFoldTerminator function can convert SwitchInst with one case (and default) to
; a conditional BranchInst. This test checks the converted BranchInst preserve the

View File

@ -1,4 +1,4 @@
; RUN: opt -S -simplifycfg < %s | FileCheck %s
; RUN: opt -S -simplifycfg -simplifycfg-require-and-preserve-domtree=1 < %s | FileCheck %s
; Don't remove invokes of nounwind functions if the personality handles async
; exceptions. The @div function in this test can fault, even though it can't

View File

@ -1,4 +1,4 @@
; RUN: opt < %s -simplifycfg -S | FileCheck %s
; RUN: opt < %s -simplifycfg -simplifycfg-require-and-preserve-domtree=1 -S | FileCheck %s
; Test that statepoint intrinsic is marked with Throwable attribute and it is
; not optimized into call

View File

@ -1,4 +1,4 @@
; RUN: opt -S -simplifycfg < %s | FileCheck %s
; RUN: opt -S -simplifycfg -simplifycfg-require-and-preserve-domtree=1 < %s | FileCheck %s
; We're sign extending an 8-bit value.
; The switch condition must be in the range [-128, 127], so any cases outside of that range must be dead.

View File

@ -1,4 +1,4 @@
; RUN: opt -S -simplifycfg < %s | FileCheck %s
; RUN: opt -S -simplifycfg -simplifycfg-require-and-preserve-domtree=1 < %s | FileCheck %s
; Radar 9342286
; Assign DebugLoc to trap instruction.
define void @foo() nounwind ssp !dbg !0 {

View File

@ -1,4 +1,4 @@
; RUN: opt -S -simplifycfg < %s | FileCheck %s
; RUN: opt -S -simplifycfg -simplifycfg-require-and-preserve-domtree=1 < %s | FileCheck %s
define void @foo() nounwind ssp #0 !dbg !0 {
; CHECK: store i32 42, i32* null
; CHECK-NOT: call void @llvm.trap()

View File

@ -1,4 +1,4 @@
; RUN: opt < %s -simplifycfg -S | FileCheck %s
; RUN: opt < %s -simplifycfg -simplifycfg-require-and-preserve-domtree=1 -S | FileCheck %s
; PR2967
target datalayout =

View File

@ -1,5 +1,5 @@
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
; RUN: opt < %s -S -simplifycfg -debug-pass=Details -enable-new-pm=0 2>&1 | FileCheck %s
; RUN: opt < %s -S -simplifycfg -simplifycfg-require-and-preserve-domtree=1 -debug-pass=Details -enable-new-pm=0 2>&1 | FileCheck %s
;; Check the report from the pass manager, telling us whether simplifycfg
;; reported the "changed" status correctly:

View File

@ -1,4 +1,4 @@
; RUN: opt < %s -simplifycfg -S | FileCheck %s
; RUN: opt < %s -simplifycfg -simplifycfg-require-and-preserve-domtree=1 -S | FileCheck %s
;
; rdar:13349374
;