1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt -passes=dse -S %s | FileCheck %s
4 @b = local_unnamed_addr global i32 0, align 4
6 ; Reduced test case for PR47285.
8 ; `store i32 9, ptr @b` in %interesting is not killed by `store i32 23, ptr @b`
9 ; in %killer, because it is not overwritten before reaching the end of the
10 ; function via %bb.2 -> %no.overwrite.exit.
12 define void @test(i1 %c.0, i1 %c.2, i1 %c.3, i1 %c.4, i1 %c.5, i1 %c.6) {
15 ; CHECK-NEXT: br label [[BB_2:%.*]]
17 ; CHECK-NEXT: br i1 [[C_0:%.*]], label [[BB_3:%.*]], label [[NO_OVERWRITE_EXIT:%.*]]
18 ; CHECK: no.overwrite.exit:
19 ; CHECK-NEXT: ret void
21 ; CHECK-NEXT: br i1 [[C_2:%.*]], label [[BB_4:%.*]], label [[BB_7:%.*]]
23 ; CHECK-NEXT: br i1 [[C_4:%.*]], label [[BB_5:%.*]], label [[BB_6:%.*]]
25 ; CHECK-NEXT: store i32 99, ptr @b, align 4
26 ; CHECK-NEXT: br i1 [[C_3:%.*]], label [[BB_5]], label [[BB_2]]
28 ; CHECK-NEXT: store i32 91, ptr @b, align 4
29 ; CHECK-NEXT: br i1 [[C_5:%.*]], label [[SPLIT_CRIT_EDGE_2:%.*]], label [[BB_2]]
30 ; CHECK: split_crit_edge.2:
31 ; CHECK-NEXT: store i32 27, ptr @b, align 4
32 ; CHECK-NEXT: br label [[EXIT:%.*]]
34 ; CHECK-NEXT: br i1 [[C_4]], label [[INTERESTING:%.*]], label [[BB_8:%.*]]
36 ; CHECK-NEXT: store i32 9, ptr @b, align 4
37 ; CHECK-NEXT: br i1 [[C_6:%.*]], label [[KILLER:%.*]], label [[BB_2]]
39 ; CHECK-NEXT: store i32 23, ptr @b, align 4
40 ; CHECK-NEXT: ret void
42 ; CHECK-NEXT: store i32 19, ptr @b, align 4
43 ; CHECK-NEXT: br i1 [[C_4]], label [[EXIT]], label [[BB_2]]
45 ; CHECK-NEXT: ret void
50 bb.2: ; preds = %bb.8, %interesting, %bb.6, %bb.5, %entry
51 br i1 %c.0, label %bb.3, label %no.overwrite.exit
53 no.overwrite.exit: ; preds = %bb.2
57 br i1 %c.2, label %bb.4, label %bb.7
60 br i1 %c.4, label %bb.5, label %bb.6
62 bb.5: ; preds = %bb.5, %bb.4
63 store i32 99, ptr @b, align 4
64 br i1 %c.3, label %bb.5, label %bb.2
67 store i32 91, ptr @b, align 4
68 br i1 %c.5, label %split_crit_edge.2, label %bb.2
70 split_crit_edge.2: ; preds = %bb.6
71 store i32 27, ptr @b, align 4
75 br i1 %c.4, label %interesting, label %bb.8
77 interesting: ; preds = %bb.7
78 store i32 9, ptr @b, align 4
79 br i1 %c.6, label %killer, label %bb.2
81 killer: ; preds = %interesting
82 store i32 23, ptr @b, align 4
86 store i32 19, ptr @b, align 4
87 br i1 %c.4, label %exit, label %bb.2
89 exit: ; preds = %bb.8, %split_crit_edge.2