Lines Matching full:index

5 //  CHECK-SAME:     %[[a:.*]]: index, %[[b:.*]]: index, %[[c:.*]]: index
7 func.func @scf_for(%a: index, %b: index, %c: index) {
9 %0 = "test.reify_bound"(%iv) {type = "LB"} : (index) -> (index)
10 %1 = "test.reify_bound"(%iv) {type = "UB"} : (index) -> (index)
11 "test.some_use"(%0, %1) : (index, index) -> ()
19 // CHECK-SAME: %[[i:.*]]: index, %[[a:.*]]: index, %[[b:.*]]: index, %[[c:.*]]: index
22 func.func @scf_for_index_result_small(%i: index, %a: index, %b: index, %c: index) {
23 %0 = scf.for %iv = %a to %b step %c iter_args(%arg = %i) -> index {
24 %1 = "test.reify_bound"(%arg) {type = "EQ"} : (index) -> (index)
25 "test.some_use"(%1) : (index) -> ()
26 scf.yield %arg : index
28 %2 = "test.reify_bound"(%0) {type = "EQ"} : (index) -> (index)
29 "test.some_use"(%2) : (index) -> ()
36 // CHECK-SAME: %[[i:.*]]: index, %[[a:.*]]: index, %[[b:.*]]: index, %[[c:.*]]: index
39 func.func @scf_for_index_result(%i: index, %a: index, %b: index, %c: index) {
40 %0 = scf.for %iv = %a to %b step %c iter_args(%arg = %i) -> index {
41 %add = arith.addi %arg, %a : index
42 %sub = arith.subi %add, %a : index
44 %1 = "test.reify_bound"(%arg) {type = "EQ"} : (index) -> (index)
45 "test.some_use"(%1) : (index) -> ()
46 scf.yield %sub : index
48 %2 = "test.reify_bound"(%0) {type = "EQ"} : (index) -> (index)
49 "test.some_use"(%2) : (index) -> ()
56 // CHECK-SAME: %[[t:.*]]: tensor<?xf32>, %[[a:.*]]: index, %[[b:.*]]: index, %[[c:.*]]: index
61 func.func @scf_for_tensor_result_small(%t: tensor<?xf32>, %a: index, %b: index, %c: index) {
63 %1 = "test.reify_bound"(%arg) {type = "EQ", dim = 0} : (tensor<?xf32>) -> (index)
64 "test.some_use"(%1) : (index) -> ()
67 %2 = "test.reify_bound"(%0) {type = "EQ", dim = 0} : (tensor<?xf32>) -> (index)
68 "test.some_use"(%2) : (index) -> ()
75 // CHECK-SAME: %[[t:.*]]: tensor<?xf32>, %[[a:.*]]: index, %[[b:.*]]: index, %[[c:.*]]: index
80 func.func @scf_for_tensor_result(%t: tensor<?xf32>, %a: index, %b: index, %c: index) {
84 %1 = "test.reify_bound"(%arg) {type = "EQ", dim = 0} : (tensor<?xf32>) -> (index)
85 "test.some_use"(%1) : (index) -> ()
88 %2 = "test.reify_bound"(%0) {type = "EQ", dim = 0} : (tensor<?xf32>) -> (index)
89 "test.some_use"(%2) : (index) -> ()
95 func.func @scf_for_swapping_yield(%t1: tensor<?xf32>, %t2: tensor<?xf32>, %a: index, %b: index, %c: index) {
103 %reify1 = "test.reify_bound"(%r1) {type = "EQ", dim = 0} : (tensor<?xf32>) -> (index)
104 "test.some_use"(%reify1) : (index) -> ()
111 // CHECK-SAME: %[[a:.*]]: index, %[[b:.*]]: index, %[[c:.*]]: index
113 func.func @scf_forall(%a: index, %b: index, %c: index) {
115 %0 = "test.reify_bound"(%iv) {type = "LB"} : (index) -> (index)
116 %1 = "test.reify_bound"(%iv) {type = "UB"} : (index) -> (index)
117 "test.some_use"(%0, %1) : (index, index) -> ()
125 // CHECK-SAME: %[[size:.*]]: index, %[[a:.*]]: index, %[[b:.*]]: index, %[[c:.*]]: index
128 func.func @scf_forall_tensor_result(%size: index, %a: index, %b: index, %c: index) {
133 %1 = "test.reify_bound"(%arg) {type = "EQ", dim = 0} : (tensor<?xf32>) -> (index)
134 "test.some_use"(%1) : (index) -> ()
139 %2 = "test.reify_bound"(%0) {type = "EQ", dim = 0} : (tensor<?xf32>) -> (index)
140 "test.some_use"(%2) : (index) -> ()
148 // CHECK: arith.constant 4 : index
149 // CHECK: arith.constant 9 : index
150 %c4 = arith.constant 4 : index
151 %c9 = arith.constant 9 : index
152 %r = scf.if %c -> index {
153 scf.yield %c4 : index
155 scf.yield %c9 : index
158 // CHECK: %[[c4:.*]] = arith.constant 4 : index
159 // CHECK: %[[c10:.*]] = arith.constant 10 : index
160 %reify1 = "test.reify_bound"(%r) {type = "LB"} : (index) -> (index)
161 %reify2 = "test.reify_bound"(%r) {type = "UB"} : (index) -> (index)
163 "test.some_use"(%reify1, %reify2) : (index, index) -> ()
172 // CHECK-SAME: %[[a:.*]]: index, %[[b:.*]]: index, %{{.*}}: i1)
173 func.func @scf_if_dynamic(%a: index, %b: index, %c : i1) {
174 %c4 = arith.constant 4 : index
175 %r = scf.if %c -> index {
176 %add1 = arith.addi %a, %b : index
177 scf.yield %add1 : index
179 %add2 = arith.addi %b, %c4 : index
180 %add3 = arith.addi %add2, %a : index
181 scf.yield %add3 : index
186 %reify1 = "test.reify_bound"(%r) {type = "LB"} : (index) -> (index)
187 %reify2 = "test.reify_bound"(%r) {type = "UB"} : (index) -> (index)
189 "test.some_use"(%reify1, %reify2) : (index, index) -> ()
195 func.func @scf_if_no_affine_bound(%a: index, %b: index, %c : i1) {
196 %r = scf.if %c -> index {
197 scf.yield %a : index
199 scf.yield %b : index
204 %reify1 = "test.reify_bound"(%r) {type = "LB"} : (index) -> (index)
205 "test.some_use"(%reify1) : (index) -> ()
213 // CHECK: arith.constant 4 : index
214 // CHECK: arith.constant 9 : index
215 %c4 = arith.constant 4 : index
216 %c9 = arith.constant 9 : index
225 // CHECK: %[[c4:.*]] = arith.constant 4 : index
226 // CHECK: %[[c10:.*]] = arith.constant 10 : index
228 : (tensor<?xf32>) -> (index)
230 : (tensor<?xf32>) -> (index)
232 "test.some_use"(%reify1, %reify2) : (index, index) -> ()
240 // CHECK-SAME: %[[a:.*]]: index, %[[b:.*]]: index, %{{.*}}: i1)
241 func.func @scf_if_eq(%a: index, %b: index, %c : i1) {
242 %c0 = arith.constant 0 : index
243 %r = scf.if %c -> index {
244 %add1 = arith.addi %a, %b : index
245 scf.yield %add1 : index
247 %add2 = arith.addi %b, %c0 : index
248 %add3 = arith.addi %add2, %a : index
249 scf.yield %add3 : index
253 %reify1 = "test.reify_bound"(%r) {type = "EQ"} : (index) -> (index)
255 "test.some_use"(%reify1) : (index) -> ()
261 func.func @compare_scf_for(%a: index, %b: index, %c: index) {
264 "test.compare"(%iv, %a) {cmp = "GE"} : (index, index) -> ()
266 "test.compare"(%iv, %b) {cmp = "LT"} : (index, index) -> ()
274 %c0 = arith.constant 0 : index
275 %c1 = arith.constant 1 : index
276 %c10 = arith.constant 10 : index
277 %0 = scf.for %iv = %c0 to %c10 step %c1 iter_args(%arg = %c0) -> index {
279 %3 = scf.if %2 -> (index) {
280 %5 = arith.addi %arg, %c1 : index
281 scf.yield %5 : index
283 scf.yield %arg : index
285 scf.yield %3 : index
288 "test.compare"(%0, %c10) {cmp = "LE"} : (index, index) -> ()
294 func.func @scf_for_result_infer_dynamic_init(%i : index) {
295 %c0 = arith.constant 0 : index
296 %c1 = arith.constant 1 : index
297 %c10 = arith.constant 10 : index
298 %0 = scf.for %iv = %c0 to %c10 step %c1 iter_args(%arg = %i) -> index {
300 %3 = scf.if %2 -> (index) {
301 %5 = arith.addi %arg, %c1 : index
302 scf.yield %5 : index
304 scf.yield %arg : index
306 scf.yield %3 : index
308 %6 = arith.addi %i, %c10 : index
310 "test.compare"(%0, %6) {cmp = "LE"} : (index, index) -> ()
316 func.func @scf_for_result_infer_dynamic_init_big_step(%i : index) {
317 %c0 = arith.constant 0 : index
318 %c1 = arith.constant 1 : index
319 %c2 = arith.constant 2 : index
320 %c4 = arith.constant 4 : index
321 %c5 = arith.constant 5 : index
322 %c10 = arith.constant 10 : index
323 %0 = scf.for %iv = %c0 to %c10 step %c2 iter_args(%arg = %i) -> index {
325 %3 = scf.if %2 -> (index) {
326 %5 = arith.addi %arg, %c1 : index
327 scf.yield %5 : index
329 scf.yield %arg : index
331 scf.yield %3 : index
333 %6 = arith.addi %i, %c5 : index
334 %7 = arith.addi %i, %c4 : index
336 "test.compare"(%0, %6) {cmp = "LE"} : (index, index) -> ()
338 "test.compare"(%0, %7) {cmp = "LE"} : (index, index) -> ()