@@ -300,3 +300,60 @@ module attributes {transform.with_named_sequence} {
300
300
transform.yield
301
301
}
302
302
}
303
+
304
+
305
+ // -----
306
+
307
+ // CHECK-LABEL: func.func @loop_pipeline
308
+ func.func @loop_pipeline (%arg0: memref <4 x16 xf32 >, %arg1: vector <16 xf32 >) -> vector <16 xf32 > {
309
+ %c0 = arith.constant 0 : index
310
+ %c1 = arith.constant 1 : index
311
+ %cst = arith.constant 0.000000e+00 : f32
312
+ %c3 = arith.constant 3 : index
313
+ // CHECK: vector.transfer_read
314
+ // CHECK: vector.transfer_read
315
+ // CHECK: vector.transfer_read
316
+ // CHECK: arith.addf
317
+ // CHECK: arith.addf
318
+ // CHECK: arith.addf
319
+ %0 = scf.for %arg2 = %c0 to %c3 step %c1 iter_args (%arg3 = %arg1 ) -> (vector <16 xf32 >) {
320
+ %1 = vector.transfer_read %arg0 [%arg2 , %c0 ], %cst {in_bounds = [true ]} : memref <4 x16 xf32 >, vector <16 xf32 >
321
+ %2 = arith.addf %1 , %arg3 : vector <16 xf32 >
322
+ scf.yield %2 : vector <16 xf32 >
323
+ }
324
+ return %0 : vector <16 xf32 >
325
+ }
326
+ module attributes {transform.with_named_sequence } {
327
+ transform.named_sequence @__transform_main (%arg1: !transform.any_op {transform.readonly }) {
328
+ %0 = transform.structured.match ops {[" scf.for" ]} in %arg1 : (!transform.any_op ) -> !transform.op <" scf.for" >
329
+ %1 = transform.loop.pipeline %0 {iteration_interval = 1 : i64 , read_latency = 5 : i64 , scheduling_type = " full-loops" } : (!transform.op <" scf.for" >) -> !transform.any_op
330
+ transform.yield
331
+ }
332
+ }
333
+
334
+
335
+ // -----
336
+
337
+ // CHECK-LABEL: func.func @loop_pipeline_lb_gt_0
338
+ func.func @loop_pipeline_lb_gt_0 (%arg0: memref <4 x16 xf32 >, %arg1: vector <16 xf32 >) -> vector <16 xf32 > {
339
+ %c1 = arith.constant 1 : index
340
+ %cst = arith.constant 0.000000e+00 : f32
341
+ %c3 = arith.constant 3 : index
342
+ // CHECK: vector.transfer_read
343
+ // CHECK: vector.transfer_read
344
+ // CHECK: arith.addf
345
+ // CHECK: arith.addf
346
+ %0 = scf.for %arg2 = %c1 to %c3 step %c1 iter_args (%arg3 = %arg1 ) -> (vector <16 xf32 >) {
347
+ %1 = vector.transfer_read %arg0 [%arg2 , %c1 ], %cst {in_bounds = [true ]} : memref <4 x16 xf32 >, vector <16 xf32 >
348
+ %2 = arith.addf %1 , %arg3 : vector <16 xf32 >
349
+ scf.yield %2 : vector <16 xf32 >
350
+ }
351
+ return %0 : vector <16 xf32 >
352
+ }
353
+ module attributes {transform.with_named_sequence } {
354
+ transform.named_sequence @__transform_main (%arg1: !transform.any_op {transform.readonly }) {
355
+ %0 = transform.structured.match ops {[" scf.for" ]} in %arg1 : (!transform.any_op ) -> !transform.op <" scf.for" >
356
+ %1 = transform.loop.pipeline %0 {iteration_interval = 1 : i64 , read_latency = 5 : i64 , scheduling_type = " full-loops" } : (!transform.op <" scf.for" >) -> !transform.any_op
357
+ transform.yield
358
+ }
359
+ }
0 commit comments