33func.func @concat(%arg0: !fir.ref<!fir.char<1,10>>, %arg1: !fir.ref<!fir.char<1, 20>>) {
44// expected-remark@+1 {{operation has no memory effects}}
55 %c30 = arith.constant 30 : index
6- // expected-remark@+2 {{found an instance of 'allocate' on a op result, on resource '<Default>'}}
7- // expected-remark@+1 {{found an instance of 'read' on a op operand, on resource '<Default>'}}
6+ // expected-remark@+3 {{found an instance of 'allocate' on op result 0, on resource '<Default>'}}
7+ // expected-remark@+2 {{found an instance of 'read' on op operand 0, on resource '<Default>'}}
8+ // expected-remark@+1 {{found an instance of 'read' on op operand 1, on resource '<Default>'}}
89 %0 = hlfir.concat %arg0, %arg1 len %c30 : (!fir.ref<!fir.char<1,10>>, !fir.ref<!fir.char<1,20>>, index) -> (!hlfir.expr<!fir.char<1,30>>)
910 return
1011}
@@ -16,8 +17,8 @@ func.func @all_no_effects(%arg0: !hlfir.expr<2x!fir.logical<4>>) {
1617}
1718
1819func.func @all_effects(%arg0: !fir.ref<!fir.array<2x10x!fir.logical<4>>>, %arg1: i32) {
19- // expected-remark@+2 {{found an instance of 'allocate' on a op result, on resource '<Default>'}}
20- // expected-remark@+1 {{found an instance of 'read' on a op operand, on resource '<Default>'}}
20+ // expected-remark@+2 {{found an instance of 'allocate' on op result 0 , on resource '<Default>'}}
21+ // expected-remark@+1 {{found an instance of 'read' on op operand 0 , on resource '<Default>'}}
2122 %all = hlfir.all %arg0 dim %arg1 : (!fir.ref<!fir.array<2x10x!fir.logical<4>>>, i32) -> !hlfir.expr<?x!fir.logical<4>>
2223 return
2324}
@@ -29,8 +30,8 @@ func.func @any_no_effects(%arg0: !hlfir.expr<2x!fir.logical<4>>) {
2930}
3031
3132func.func @any_effects(%arg0: !fir.ref<!fir.array<2x10x!fir.logical<4>>>, %arg1: i32) {
32- // expected-remark@+2 {{found an instance of 'allocate' on a op result, on resource '<Default>'}}
33- // expected-remark@+1 {{found an instance of 'read' on a op operand, on resource '<Default>'}}
33+ // expected-remark@+2 {{found an instance of 'allocate' on op result 0 , on resource '<Default>'}}
34+ // expected-remark@+1 {{found an instance of 'read' on op operand 0 , on resource '<Default>'}}
3435 %all = hlfir.any %arg0 dim %arg1 : (!fir.ref<!fir.array<2x10x!fir.logical<4>>>, i32) -> !hlfir.expr<?x!fir.logical<4>>
3536 return
3637}
@@ -42,7 +43,7 @@ func.func @count_no_effects(%arg0: !hlfir.expr<2x!fir.logical<4>>) {
4243}
4344
4445func.func @count_effects(%arg0: !fir.ref<!fir.array<2x10x!fir.logical<4>>>, %arg1: i32) {
45- // expected-remark@+1 {{found an instance of 'read' on a op operand, on resource '<Default>'}}
46+ // expected-remark@+1 {{found an instance of 'read' on op operand 0 , on resource '<Default>'}}
4647 %all = hlfir.count %arg0 dim %arg1 : (!fir.ref<!fir.array<2x10x!fir.logical<4>>>, i32) -> i32
4748 return
4849}
@@ -54,15 +55,15 @@ func.func @product_no_effects(%arg0: !hlfir.expr<?xf32>) {
5455}
5556
5657func.func @product_effects(%arg0: !fir.ref<!fir.array<2x2xf32>>, %arg1: i32) {
57- // expected-remark@+2 {{found an instance of 'allocate' on a op result, on resource '<Default>'}}
58- // expected-remark@+1 {{found an instance of 'read' on a op operand, on resource '<Default>'}}
58+ // expected-remark@+2 {{found an instance of 'allocate' on op result 0 , on resource '<Default>'}}
59+ // expected-remark@+1 {{found an instance of 'read' on op operand 0 , on resource '<Default>'}}
5960 %product = hlfir.product %arg0 dim %arg1 : (!fir.ref<!fir.array<2x2xf32>>, i32) -> !hlfir.expr<2xf32>
6061 return
6162}
6263
6364func.func @set_length_read(%arg0: !fir.ref<!fir.char<1,10>>, %arg1: index) {
64- // expected-remark@+2 {{found an instance of 'allocate' on a op result, on resource '<Default>'}}
65- // expected-remark@+1 {{found an instance of 'read' on a op operand, on resource '<Default>'}}
65+ // expected-remark@+2 {{found an instance of 'allocate' on op result 0 , on resource '<Default>'}}
66+ // expected-remark@+1 {{found an instance of 'read' on op operand 0 , on resource '<Default>'}}
6667 %0 = hlfir.set_length %arg0 len %arg1 : (!fir.ref<!fir.char<1,10>>, index) -> !hlfir.expr<!fir.char<1,?>>
6768 return
6869}
@@ -74,8 +75,8 @@ func.func @sum_no_effects(%arg0: !hlfir.expr<?xf32>) {
7475}
7576
7677func.func @sum_effects(%arg0: !fir.ref<!fir.array<2x2xf32>>, %arg1: i32) {
77- // expected-remark@+2 {{found an instance of 'allocate' on a op result, on resource '<Default>'}}
78- // expected-remark@+1 {{found an instance of 'read' on a op operand, on resource '<Default>'}}
78+ // expected-remark@+2 {{found an instance of 'allocate' on op result 0 , on resource '<Default>'}}
79+ // expected-remark@+1 {{found an instance of 'read' on op operand 0 , on resource '<Default>'}}
7980 %sum = hlfir.sum %arg0 dim %arg1 : (!fir.ref<!fir.array<2x2xf32>>, i32) -> !hlfir.expr<2xf32>
8081 return
8182}
@@ -87,8 +88,8 @@ func.func @maxval_no_effects(%arg0: !hlfir.expr<?xf32>) {
8788}
8889
8990func.func @maxval_effects(%arg0: !fir.ref<!fir.array<2x2xf32>>, %arg1: i32) {
90- // expected-remark@+2 {{found an instance of 'allocate' on a op result, on resource '<Default>'}}
91- // expected-remark@+1 {{found an instance of 'read' on a op operand, on resource '<Default>'}}
91+ // expected-remark@+2 {{found an instance of 'allocate' on op result 0 , on resource '<Default>'}}
92+ // expected-remark@+1 {{found an instance of 'read' on op operand 0 , on resource '<Default>'}}
9293 %maxval = hlfir.maxval %arg0 dim %arg1 : (!fir.ref<!fir.array<2x2xf32>>, i32) -> !hlfir.expr<2xf32>
9394 return
9495}
@@ -100,34 +101,34 @@ func.func @minval_no_effects(%arg0: !hlfir.expr<?xf32>) {
100101}
101102
102103func.func @minval_effects(%arg0: !fir.ref<!fir.array<2x2xf32>>, %arg1: i32) {
103- // expected-remark@+2 {{found an instance of 'allocate' on a op result, on resource '<Default>'}}
104- // expected-remark@+1 {{found an instance of 'read' on a op operand, on resource '<Default>'}}
104+ // expected-remark@+2 {{found an instance of 'allocate' on op result 0 , on resource '<Default>'}}
105+ // expected-remark@+1 {{found an instance of 'read' on op operand 0 , on resource '<Default>'}}
105106 %minval = hlfir.minval %arg0 dim %arg1 : (!fir.ref<!fir.array<2x2xf32>>, i32) -> !hlfir.expr<2xf32>
106107 return
107108}
108109
109110func.func @minloc_effects_simple(%arg0: !hlfir.expr<?xf32>) {
110- // expected-remark@+1 {{found an instance of 'allocate' on a op result, on resource '<Default>'}}
111+ // expected-remark@+1 {{found an instance of 'allocate' on op result 0 , on resource '<Default>'}}
111112 %minloc = hlfir.minloc %arg0 : (!hlfir.expr<?xf32>) -> !hlfir.expr<?xi32>
112113 return
113114}
114115
115116func.func @minloc_effects(%arg0: !fir.ref<!fir.array<2x2xf32>>, %arg1: i32) {
116- // expected-remark@+2 {{found an instance of 'allocate' on a op result, on resource '<Default>'}}
117- // expected-remark@+1 {{found an instance of 'read' on a op operand, on resource '<Default>'}}
117+ // expected-remark@+2 {{found an instance of 'allocate' on op result 0 , on resource '<Default>'}}
118+ // expected-remark@+1 {{found an instance of 'read' on op operand 0 , on resource '<Default>'}}
118119 %minloc = hlfir.minloc %arg0 dim %arg1 : (!fir.ref<!fir.array<2x2xf32>>, i32) -> !hlfir.expr<2xi32>
119120 return
120121}
121122
122123func.func @maxloc_effects_simple(%arg0: !hlfir.expr<?xf32>) {
123- // expected-remark@+1 {{found an instance of 'allocate' on a op result, on resource '<Default>'}}
124+ // expected-remark@+1 {{found an instance of 'allocate' on op result 0 , on resource '<Default>'}}
124125 %maxloc = hlfir.maxloc %arg0 : (!hlfir.expr<?xf32>) -> !hlfir.expr<?xi32>
125126 return
126127}
127128
128129func.func @maxloc_effects(%arg0: !fir.ref<!fir.array<2x2xf32>>, %arg1: i32) {
129- // expected-remark@+2 {{found an instance of 'allocate' on a op result, on resource '<Default>'}}
130- // expected-remark@+1 {{found an instance of 'read' on a op operand, on resource '<Default>'}}
130+ // expected-remark@+2 {{found an instance of 'allocate' on op result 0 , on resource '<Default>'}}
131+ // expected-remark@+1 {{found an instance of 'read' on op operand 0 , on resource '<Default>'}}
131132 %maxloc = hlfir.maxloc %arg0 dim %arg1 : (!fir.ref<!fir.array<2x2xf32>>, i32) -> !hlfir.expr<2xi32>
132133 return
133134}
@@ -139,49 +140,49 @@ func.func @dot_product_no_effects(%arg0: !hlfir.expr<?xf32>, %arg1: !hlfir.expr<
139140}
140141
141142func.func @dot_product_effects(%arg0: !fir.ref<!fir.array<10xf32>>, %arg1: !fir.ref<!fir.array<10xf32>>) {
142- // there are read effects on both arguments - the diagnostic verification just doesn't register duplicate identical diagnostics
143- // expected-remark@+1 {{found an instance of 'read' on a op operand, on resource '<Default>'}}
143+ // expected-remark@+2 {{found an instance of 'read' on op operand 0, on resource '<Default>'}}
144+ // expected-remark@+1 {{found an instance of 'read' on op operand 1 , on resource '<Default>'}}
144145 %0 = hlfir.dot_product %arg0 %arg1 : (!fir.ref<!fir.array<10xf32>>, !fir.ref<!fir.array<10xf32>>) -> f32
145146 return
146147}
147148
148149func.func @matmul_no_reads(%arg0: !hlfir.expr<?x?xf32>, %arg1: !hlfir.expr<?x?xf32>) {
149- // expected-remark@+1 {{found an instance of 'allocate' on a op result, on resource '<Default>'}}
150+ // expected-remark@+1 {{found an instance of 'allocate' on op result 0 , on resource '<Default>'}}
150151 %0 = hlfir.matmul %arg0 %arg1 : (!hlfir.expr<?x?xf32>, !hlfir.expr<?x?xf32>) -> !hlfir.expr<?x?xf32>
151152 return
152153}
153154
154155func.func @matmul_reads(%arg0: !fir.ref<!fir.array<10x5xf32>>, %arg1: !fir.ref<!fir.array<5x10xf32>>) {
155- // expected-remark@+3 {{found an instance of 'allocate' on a op result, on resource '<Default>'}}
156- // there are read effects on both arguments - the diagnostic verification just doesn't register duplicate identical diagnostics
157- // expected-remark@+1 {{found an instance of 'read' on a op operand, on resource '<Default>'}}
156+ // expected-remark@+3 {{found an instance of 'allocate' on op result 0 , on resource '<Default>'}}
157+ // expected-remark@+2 {{found an instance of 'read' on op operand 0, on resource '<Default>'}}
158+ // expected-remark@+1 {{found an instance of 'read' on op operand 1 , on resource '<Default>'}}
158159 %0 = hlfir.matmul %arg0 %arg1 : (!fir.ref<!fir.array<10x5xf32>>, !fir.ref<!fir.array<5x10xf32>>) -> !hlfir.expr<10x10xf32>
159160 return
160161}
161162
162163func.func @transpose_no_reads(%arg0: !hlfir.expr<?x?xf32>) {
163- // expected-remark@+1 {{found an instance of 'allocate' on a op result, on resource '<Default>'}}
164+ // expected-remark@+1 {{found an instance of 'allocate' on op result 0 , on resource '<Default>'}}
164165 %0 = hlfir.transpose %arg0 : (!hlfir.expr<?x?xf32>) -> !hlfir.expr<?x?xf32>
165166 return
166167}
167168
168169func.func @transpose_read(%arg0: !fir.ref<!fir.array<10x5xf32>>) {
169- // expected-remark@+2 {{found an instance of 'allocate' on a op result, on resource '<Default>'}}
170- // expected-remark@+1 {{found an instance of 'read' on a op operand, on resource '<Default>'}}
170+ // expected-remark@+2 {{found an instance of 'allocate' on op result 0 , on resource '<Default>'}}
171+ // expected-remark@+1 {{found an instance of 'read' on op operand 0 , on resource '<Default>'}}
171172 %0 = hlfir.transpose %arg0 : (!fir.ref<!fir.array<10x5xf32>>) -> !hlfir.expr<5x10xf32>
172173 return
173174}
174175
175176func.func @matmul_transpose_no_reads(%arg0: !hlfir.expr<?x?xf32>, %arg1: !hlfir.expr<?x?xf32>) {
176- // expected-remark@+1 {{found an instance of 'allocate' on a op result, on resource '<Default>'}}
177+ // expected-remark@+1 {{found an instance of 'allocate' on op result 0 , on resource '<Default>'}}
177178 %0 = hlfir.matmul_transpose %arg0 %arg1 : (!hlfir.expr<?x?xf32>, !hlfir.expr<?x?xf32>) -> !hlfir.expr<?x?xf32>
178179 return
179180}
180181
181182func.func @matmul_transpose_reads(%arg0: !fir.ref<!fir.array<5x10xf32>>, %arg1: !fir.ref<!fir.array<5x10xf32>>) {
182- // expected-remark@+3 {{found an instance of 'allocate' on a op result, on resource '<Default>'}}
183- // there are read effects on both arguments - the diagnostic verification just doesn't register duplicate identical diagnostics
184- // expected-remark@+1 {{found an instance of 'read' on a op operand, on resource '<Default>'}}
183+ // expected-remark@+3 {{found an instance of 'allocate' on op result 0 , on resource '<Default>'}}
184+ // expected-remark@+2 {{found an instance of 'read' on op operand 0, on resource '<Default>'}}
185+ // expected-remark@+1 {{found an instance of 'read' on op operand 1 , on resource '<Default>'}}
185186 %0 = hlfir.matmul_transpose %arg0 %arg1 : (!fir.ref<!fir.array<5x10xf32>>, !fir.ref<!fir.array<5x10xf32>>) -> !hlfir.expr<10x10xf32>
186187 return
187188}
@@ -195,37 +196,37 @@ func.func @associate(%arg0: i32) {
195196}
196197
197198func.func @as_expr_read(%arg0: !fir.ref<!fir.array<2xi32>>) {
198- // expected-remark@+2 {{found an instance of 'allocate' on a op result, on resource '<Default>'}}
199- // expected-remark@+1 {{found an instance of 'read' on a op operand, on resource '<Default>'}}
199+ // expected-remark@+2 {{found an instance of 'allocate' on op result 0 , on resource '<Default>'}}
200+ // expected-remark@+1 {{found an instance of 'read' on op operand 0 , on resource '<Default>'}}
200201 %0 = hlfir.as_expr %arg0 : (!fir.ref<!fir.array<2xi32>>) -> !hlfir.expr<?xi32>
201202// expected-remark@+1 {{found an instance of 'free' on resource '<Default>'}}
202203 hlfir.destroy %0 : !hlfir.expr<?xi32>
203204 return
204205}
205206
206207func.func @char_extremum(%arg0: !fir.ref<!fir.char<1,10>>, %arg1: !fir.ref<!fir.char<1,20>>) {
207- // expected-remark@+3 {{found an instance of 'allocate' on a op result, on resource '<Default>'}}
208- // there are read effects on both arguments - the diagnostic verification just doesn't register duplicate identical diagnostics
209- // expected-remark@+1 {{found an instance of 'read' on a op operand, on resource '<Default>'}}
208+ // expected-remark@+3 {{found an instance of 'allocate' on op result 0 , on resource '<Default>'}}
209+ // expected-remark@+2 {{found an instance of 'read' on op operand 0, on resource '<Default>'}}
210+ // expected-remark@+1 {{found an instance of 'read' on op operand 1 , on resource '<Default>'}}
210211 %0 = hlfir.char_extremum min, %arg0, %arg1 : (!fir.ref<!fir.char<1, 10>>, !fir.ref<!fir.char<1,20>>) -> !hlfir.expr<!fir.char<1,10>>
211212 return
212213}
213214
214215func.func @copy_in(%box: !fir.box<!fir.array<?xf64>>, %temp: !fir.ref<!fir.box<!fir.heap<!fir.array<?xf64>>>>, %is_present: i1) {
215216// expected-remark@+3 {{found an instance of 'allocate' on resource '<Default>'}}
216- // expected-remark@+2 {{found an instance of 'read' on a op operand, on resource '<Default>'}}
217- // expected-remark@+1 {{found an instance of 'write' on a op operand, on resource '<Default>'}}
217+ // expected-remark@+2 {{found an instance of 'read' on op operand 0 , on resource '<Default>'}}
218+ // expected-remark@+1 {{found an instance of 'write' on op operand 1 , on resource '<Default>'}}
218219 %0:2 = hlfir.copy_in %box to %temp : (!fir.box<!fir.array<?xf64>>, !fir.ref<!fir.box<!fir.heap<!fir.array<?xf64>>>>) -> (!fir.box<!fir.array<?xf64>>, i1)
219220 return
220221}
221222
222223func.func @copy_out(%box: !fir.box<!fir.array<?xf64>>, %temp: !fir.ref<!fir.box<!fir.heap<!fir.array<?xf64>>>>, %was_copied: i1) {
223224// expected-remark@+2 {{found an instance of 'free' on resource '<Default>'}}
224- // expected-remark@+1 {{found an instance of 'read' on a op operand, on resource '<Default>'}}
225+ // expected-remark@+1 {{found an instance of 'read' on op operand 0 , on resource '<Default>'}}
225226 hlfir.copy_out %temp, %was_copied : (!fir.ref<!fir.box<!fir.heap<!fir.array<?xf64>>>>, i1) -> ()
226227// expected-remark@+3 {{found an instance of 'free' on resource '<Default>'}}
227- // expected-remark@+2 {{found an instance of 'read' on a op operand, on resource '<Default>'}}
228- // expected-remark@+1 {{found an instance of 'write' on a op operand, on resource '<Default>'}}
228+ // expected-remark@+2 {{found an instance of 'read' on op operand 0 , on resource '<Default>'}}
229+ // expected-remark@+1 {{found an instance of 'write' on op operand 2 , on resource '<Default>'}}
229230 hlfir.copy_out %temp, %was_copied to %box : (!fir.ref<!fir.box<!fir.heap<!fir.array<?xf64>>>>, i1, !fir.box<!fir.array<?xf64>>) -> ()
230231 return
231232}
0 commit comments