1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt -passes=instcombine -S < %s | FileCheck %s
4 define void @test01(ptr %ptr0, ptr %ptr1) {
5 ; CHECK-LABEL: @test01(
6 ; CHECK-NEXT: store i8 42, ptr [[PTR0:%.*]], align 1
7 ; CHECK-NEXT: store i8 43, ptr [[PTR1:%.*]], align 1
10 call void @llvm.experimental.noalias.scope.decl(metadata !0)
11 store i8 42, ptr %ptr0
12 store i8 43, ptr %ptr1
16 define void @test02_keep(ptr %ptr0, ptr %ptr1) {
17 ; CHECK-LABEL: @test02_keep(
18 ; CHECK-NEXT: call void @llvm.experimental.noalias.scope.decl(metadata !0)
19 ; CHECK-NEXT: store i8 42, ptr [[PTR0:%.*]], align 1, !alias.scope !0
20 ; CHECK-NEXT: store i8 43, ptr [[PTR1:%.*]], align 1, !noalias !3
21 ; CHECK-NEXT: ret void
23 call void @llvm.experimental.noalias.scope.decl(metadata !0)
24 store i8 42, ptr %ptr0, !alias.scope !0
25 store i8 43, ptr %ptr1, !noalias !5
29 define void @test03(ptr %ptr0, ptr %ptr1) {
30 ; CHECK-LABEL: @test03(
31 ; CHECK-NEXT: store i8 42, ptr [[PTR0:%.*]], align 1, !alias.scope !5
32 ; CHECK-NEXT: store i8 43, ptr [[PTR1:%.*]], align 1, !noalias !3
33 ; CHECK-NEXT: ret void
35 call void @llvm.experimental.noalias.scope.decl(metadata !0)
36 store i8 42, ptr %ptr0, !alias.scope !3
37 store i8 43, ptr %ptr1, !noalias !5
41 define void @test04_keep(ptr %ptr0, ptr %ptr1) {
42 ; CHECK-LABEL: @test04_keep(
43 ; CHECK-NEXT: call void @llvm.experimental.noalias.scope.decl(metadata !0)
44 ; CHECK-NEXT: store i8 42, ptr [[PTR0:%.*]], align 1, !alias.scope !3
45 ; CHECK-NEXT: store i8 43, ptr [[PTR1:%.*]], align 1, !noalias !3
46 ; CHECK-NEXT: ret void
48 call void @llvm.experimental.noalias.scope.decl(metadata !0)
49 store i8 42, ptr %ptr0, !alias.scope !5
50 store i8 43, ptr %ptr1, !noalias !5
54 define void @test05_keep(ptr %ptr0, ptr %ptr1) {
55 ; CHECK-LABEL: @test05_keep(
56 ; CHECK-NEXT: call void @llvm.experimental.noalias.scope.decl(metadata !0)
57 ; CHECK-NEXT: store i8 42, ptr [[PTR0:%.*]], align 1, !alias.scope !3
58 ; CHECK-NEXT: store i8 43, ptr [[PTR1:%.*]], align 1, !noalias !0
59 ; CHECK-NEXT: ret void
61 call void @llvm.experimental.noalias.scope.decl(metadata !0)
62 store i8 42, ptr %ptr0, !alias.scope !5
63 store i8 43, ptr %ptr1, !noalias !0
67 define void @test06(ptr %ptr0, ptr %ptr1) {
68 ; CHECK-LABEL: @test06(
69 ; CHECK-NEXT: store i8 42, ptr [[PTR0:%.*]], align 1, !alias.scope !3
70 ; CHECK-NEXT: store i8 43, ptr [[PTR1:%.*]], align 1, !noalias !5
71 ; CHECK-NEXT: ret void
73 call void @llvm.experimental.noalias.scope.decl(metadata !0)
74 store i8 42, ptr %ptr0, !alias.scope !5
75 store i8 43, ptr %ptr1, !noalias !3
79 define void @test07(ptr %ptr0, ptr %ptr1) {
80 ; CHECK-LABEL: @test07(
81 ; CHECK-NEXT: store i8 42, ptr [[PTR0:%.*]], align 1, !alias.scope !0
82 ; CHECK-NEXT: store i8 43, ptr [[PTR1:%.*]], align 1, !noalias !5
83 ; CHECK-NEXT: ret void
85 call void @llvm.experimental.noalias.scope.decl(metadata !0)
86 store i8 42, ptr %ptr0, !alias.scope !0
87 store i8 43, ptr %ptr1, !noalias !3
91 define void @test08(ptr %ptr0, ptr %ptr1) {
92 ; CHECK-LABEL: @test08(
93 ; CHECK-NEXT: store i8 42, ptr [[PTR0:%.*]], align 1, !alias.scope !5
94 ; CHECK-NEXT: store i8 43, ptr [[PTR1:%.*]], align 1, !noalias !0
95 ; CHECK-NEXT: ret void
97 call void @llvm.experimental.noalias.scope.decl(metadata !0)
98 store i8 42, ptr %ptr0, !alias.scope !3
99 store i8 43, ptr %ptr1, !noalias !0
103 define void @test11(ptr %ptr0) {
104 ; CHECK-LABEL: @test11(
105 ; CHECK-NEXT: store i8 42, ptr [[PTR0:%.*]], align 1, !alias.scope !0
106 ; CHECK-NEXT: ret void
108 call void @llvm.experimental.noalias.scope.decl(metadata !0)
109 store i8 42, ptr %ptr0, !alias.scope !0
113 define void @test12(ptr %ptr0) {
114 ; CHECK-LABEL: @test12(
115 ; CHECK-NEXT: store i8 42, ptr [[PTR0:%.*]], align 1, !alias.scope !5
116 ; CHECK-NEXT: ret void
118 call void @llvm.experimental.noalias.scope.decl(metadata !0)
119 store i8 42, ptr %ptr0, !alias.scope !3
123 define void @test13(ptr %ptr0) {
124 ; CHECK-LABEL: @test13(
125 ; CHECK-NEXT: store i8 42, ptr [[PTR0:%.*]], align 1, !alias.scope !3
126 ; CHECK-NEXT: ret void
128 call void @llvm.experimental.noalias.scope.decl(metadata !0)
129 store i8 42, ptr %ptr0, !alias.scope !5
133 define void @test14(ptr %ptr0) {
134 ; CHECK-LABEL: @test14(
135 ; CHECK-NEXT: store i8 42, ptr [[PTR0:%.*]], align 1, !noalias !0
136 ; CHECK-NEXT: ret void
138 call void @llvm.experimental.noalias.scope.decl(metadata !0)
139 store i8 42, ptr %ptr0, !noalias !0
143 define void @test15(ptr %ptr0) {
144 ; CHECK-LABEL: @test15(
145 ; CHECK-NEXT: store i8 42, ptr [[PTR0:%.*]], align 1, !noalias !5
146 ; CHECK-NEXT: ret void
148 call void @llvm.experimental.noalias.scope.decl(metadata !0)
149 store i8 42, ptr %ptr0, !noalias !3
153 define void @test16(ptr %ptr0) {
154 ; CHECK-LABEL: @test16(
155 ; CHECK-NEXT: store i8 42, ptr [[PTR0:%.*]], align 1, !noalias !3
156 ; CHECK-NEXT: ret void
158 call void @llvm.experimental.noalias.scope.decl(metadata !0)
159 store i8 42, ptr %ptr0, !noalias !5
163 declare void @llvm.experimental.noalias.scope.decl(metadata)
166 !1 = distinct !{ !1, !2 }
167 !2 = distinct !{ !2 }
169 !4 = distinct !{ !4, !2 }