1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt < %s -passes=dse -S | FileCheck %s
4 target datalayout = "e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64"
5 declare void @unknown_func()
7 define void @test6_store_same_value(ptr noalias %P) {
8 ; CHECK-LABEL: @test6_store_same_value(
9 ; CHECK-NEXT: store i32 0, ptr [[P:%.*]], align 4
10 ; CHECK-NEXT: br i1 true, label [[BB1:%.*]], label [[BB2:%.*]]
12 ; CHECK-NEXT: br label [[BB3:%.*]]
14 ; CHECK-NEXT: call void @unknown_func()
15 ; CHECK-NEXT: br label [[BB3]]
17 ; CHECK-NEXT: store i32 0, ptr [[P]], align 4
18 ; CHECK-NEXT: ret void
21 br i1 true, label %bb1, label %bb2
25 call void @unknown_func()
32 define void @test6_store_other_value(ptr noalias %P) {
33 ; CHECK-LABEL: @test6_store_other_value(
34 ; CHECK-NEXT: store i32 0, ptr [[P:%.*]], align 4
35 ; CHECK-NEXT: br i1 true, label [[BB1:%.*]], label [[BB2:%.*]]
37 ; CHECK-NEXT: br label [[BB3:%.*]]
39 ; CHECK-NEXT: call void @unknown_func()
40 ; CHECK-NEXT: br label [[BB3]]
42 ; CHECK-NEXT: store i32 1, ptr [[P]], align 4
43 ; CHECK-NEXT: ret void
46 br i1 true, label %bb1, label %bb2
50 call void @unknown_func()
57 define void @test23(ptr noalias %P) {
58 ; CHECK-LABEL: @test23(
59 ; CHECK-NEXT: br i1 true, label [[BB1:%.*]], label [[BB2:%.*]]
61 ; CHECK-NEXT: br label [[BB3:%.*]]
63 ; CHECK-NEXT: call void @unknown_func()
64 ; CHECK-NEXT: br label [[BB3]]
66 ; CHECK-NEXT: store i32 0, ptr [[P:%.*]], align 4
67 ; CHECK-NEXT: ret void
69 br i1 true, label %bb1, label %bb2
74 call void @unknown_func()
82 define void @test24(ptr noalias %P) {
83 ; CHECK-LABEL: @test24(
84 ; CHECK-NEXT: br i1 true, label [[BB2:%.*]], label [[BB1:%.*]]
86 ; CHECK-NEXT: br label [[BB3:%.*]]
88 ; CHECK-NEXT: call void @unknown_func()
89 ; CHECK-NEXT: br label [[BB3]]
91 ; CHECK-NEXT: store i32 0, ptr [[P:%.*]], align 4
92 ; CHECK-NEXT: ret void
94 br i1 true, label %bb2, label %bb1
99 call void @unknown_func()