@@ -808,30 +808,27 @@ def dynamic_copy(a: tkl.Memory[M, N, ADDRESS_SPACE, tkl.f16]):
808808 print (dynamic_copy .asm )
809809
810810 # CHECK-LABEL: test_dynamic_copy
811- # CHECK-DAG: #[[dc_map_ceildiv:.*]] = affine_map<()[s0] -> (s0 ceildiv 16)>
812- # CHECK-DAG: #[[dc_map_row:.*]] = affine_map<()[s0, s1] -> (s0 + s1 * 16 - (s0 floordiv 64) * 48)>
813- # CHECK-DAG: #[[dc_map_colbase:.*]] = affine_map<()[s0] -> (s0 * 16)>
814- # CHECK-DAG: #[[dc_map_linear:.*]] = affine_map<()[s0, s1, s2, s3] -> ((s0 * s1) * 16 + s0 * s2 + s3 * 16 - ((s2 floordiv 64) * s0) * 48)>
811+ # CHECK-DAG: #[[map1:.*]] = affine_map<()[s0] -> (s0 * 16)>
812+ # CHECK-DAG: #[[map2:.*]] = affine_map<()[s0, s1] -> (s0 + s1 * 16 - (s0 floordiv 64) * 48)>
815813 # CHECK: func.func @dynamic_copy
816- # CHECK -SAME: (%[[ARG0:.*]]: !stream.binding, %[[ARG1:.*]]: index, %[[ARG2:.*]]: index)
814+ # CHECH -SAME: (%[[ARG0:.*]]: !stream.binding, %[[ARG1:.*]]: index, %[[ARG2:.*]]: index)
817815 # CHECK-DAG: %[[CST:.*]] = arith.constant dense<0.000000e+00> : vector<16xf16>
818816 # CHECK-DAG: %[[CST_0:.*]] = arith.constant dense<[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]> : vector<16xindex>
819817 # CHECK-DAG: %[[C0:.*]] = arith.constant 0 : index
820818 # CHECK-DAG: %[[WORKGROUP_ID_0:.*]] = gpu.block_id x
821819 # CHECK-DAG: %[[WORKGROUP_ID_1:.*]] = gpu.block_id y
822820 # CHECK-DAG: %[[THREAD_ID_X:.*]] = gpu.thread_id x
823- # CHECK: %[[D1:.*]] = affine.apply #[[dc_map_row]]()[%[[THREAD_ID_X]], %[[WORKGROUP_ID_0]]]
824- # CHECK: %[[D2:.*]] = arith.cmpi slt, %[[D1]], %arg1 : index
825- # CHECK: %[[D3:.*]] = vector.broadcast %[[D2]] : i1 to vector<16xi1>
826- # CHECK: %[[D4:.*]] = affine.apply #[[dc_map_colbase]]()[%[[WORKGROUP_ID_1]]]
827- # CHECK: %[[D5:.*]] = vector.broadcast %[[D4]] : index to vector<16xindex>
828- # CHECK: %[[D6:.*]] = arith.addi %[[D5]], %[[CST_0]] overflow<nsw, nuw> : vector<16xindex>
829- # CHECK: %[[D7:.*]] = vector.broadcast %arg2 : index to vector<16xindex>
830- # CHECK: %[[D8:.*]] = arith.cmpi slt, %[[D6]], %[[D7]] : vector<16xindex>
831- # CHECK: %[[D9:.*]] = arith.andi %[[D3]], %[[D8]] : vector<16xi1>
832- # CHECK: %[[D10:.*]] = affine.apply #[[dc_map_linear]]()[%arg2, %[[WORKGROUP_ID_0]], %[[THREAD_ID_X]], %[[WORKGROUP_ID_1]]]
833- # CHECK: %[[D11:.*]] = vector.maskedload %{{.*}}[%[[D10]]], %[[D9]], %[[CST]] : memref<1073741822xf16, strided<[1]>>, vector<16xi1>, vector<16xf16> into vector<16xf16>
834- # CHECK: vector.maskedstore {{.*}}[{{.*}}], %[[D9]], %[[D11]] : memref<{{.*}}xf16{{.*}}>, vector<16xi1>, vector<16xf16>
821+ # CHECK: %[[D1:.*]] = affine.apply #[[map1]]()[%[[WORKGROUP_ID_1]]]
822+ # CHECK: %[[D2:.*]] = vector.broadcast %[[D1]] : index to vector<16xindex>
823+ # CHECK: %[[D3:.*]] = arith.addi %[[D2]], %[[CST_0]] overflow<nsw, nuw> : vector<16xindex>
824+ # CHECK: %[[D4:.*]] = vector.broadcast %{{.*}} : index to vector<16xindex>
825+ # CHECK: %[[D5:.*]] = arith.cmpi slt, %[[D3]], %[[D4]] : vector<16xindex>
826+ # CHECK: %[[D6:.*]] = affine.apply #[[map2]]()[%[[THREAD_ID_X]], %[[WORKGROUP_ID_0]]]
827+ # CHECK: %[[D7:.*]] = arith.cmpi slt, %[[D6]], %{{.*}} : index
828+ # CHECK: %[[D8:.*]] = vector.broadcast %[[D7]] : i1 to vector<16xi1>
829+ # CHECK: %[[D9:.*]] = arith.andi %[[D5]], %[[D8]] : vector<16xi1>
830+ # CHECK: %[[D10:.*]] = vector.maskedload %{{.*}}[%{{.*}}], %[[D9]], %[[CST]] : memref<1073741822xf16, strided<[1]>>, vector<16xi1>, vector<16xf16> into vector<16xf16>
831+ # CHECK: vector.maskedstore {{.*}}[{{.*}}], %[[D9]], %[[D10]] : memref<{{.*}}xf16{{.*}}>, vector<16xi1>, vector<16xf16>
835832 # CHECK: func.func @isolated_benchmark$async(%[[ARG:.*]]: !hal.buffer_view, %[[FENCE:.*]]: !hal.fence, %{{.*}}: !hal.fence)
836833 # CHECK: %[[D0:.*]] = hal.buffer_view.dim<%[[ARG]] : !hal.buffer_view>[0] : index
837834 # CHECK: %[[D1:.*]] = hal.buffer_view.dim<%[[ARG]] : !hal.buffer_view>[1] : index
@@ -1635,26 +1632,20 @@ def repeat(
16351632 print (test .asm )
16361633
16371634 # CHECK-LABEL: test_tiled_reduce_min_unaligned
1638- # CHECK-DAG: #[[tr_map_lane:.*]] = affine_map<()[s0] -> (s0 * 2 - (s0 floordiv 64) * 128)>
1639- # CHECK-DAG: #[[tr_map_blk:.*]] = affine_map<()[s0, s1] -> (s0 * 527 + s1 * 2 - (s1 floordiv 64) * 128)>
1635+ # CHECK-DAG: #[[map1:.*]] = affine_map<()[s0, s1] -> (s0 * 128 + s1 * 2 - (s1 floordiv 64) * 128)>
16401636 # CHECK: func @tiled_reduce_min_unaligned
16411637 # CHECK-DAG: %[[cst_0:.*]] = arith.constant dense<527> : vector<2xindex>
16421638 # CHECK-DAG: %[[cst_1:.*]] = arith.constant dense<[0, 1]> : vector<2xindex>
16431639 # CHECK-DAG: %[[C0:.*]] = arith.constant 0 : index
16441640 # CHECK-DAG: %[[C1:.*]] = arith.constant 1 : index
16451641 # CHECK-DAG: %[[C5:.*]] = arith.constant 5 : index
1646- # CHECK-DAG: %[[C128:.*]] = arith.constant 128 : index
1647- # CHECK-DAG: %[[BLK_Y:.+]] = gpu.block_id y
16481642 # CHECK: %[[THREAD_ID_X:.+]] = gpu.thread_id x
1649- # CHECK: %{{.*}} = affine.apply #[[tr_map_lane]]()[%[[THREAD_ID_X]]]
1650- # CHECK: %{{.*}} = affine.apply #[[tr_map_blk]]()[%[[BLK_Y]], %[[THREAD_ID_X]]]
16511643 # Tiled Reduction Loop
16521644 # CHECK: scf.for %[[ITER:.*]] = %[[C0]] to %[[C5]] step %[[C1]]
1653- # CHECK: %[[MUL_K:.*]] = arith.muli %[[ITER]], %[[C128]] overflow<nsw, nuw> : index
1654- # CHECK: vector.broadcast %[[MUL_K]] : index to vector<2xindex>
1655- # CHECK: arith.addi {{.*}}, {{.*}} overflow<nsw, nuw> : vector<2xindex>
1656- # CHECK: %[[D9:.*]] = arith.cmpi slt, {{.*}}, %[[cst_0]] : vector<2xindex>
1657- # CHECK: arith.addi {{.*}}, %[[MUL_K]] overflow<nsw, nuw> : index
1645+ # CHECK: %[[D6:.*]] = affine.apply #[[map1]]()[%[[ITER]], %[[THREAD_ID_X]]]
1646+ # CHECK: %[[D7:.*]] = vector.broadcast %[[D6]] : index to vector<2xindex>
1647+ # CHECK: %[[D8:.*]] = arith.addi %[[D7]], %[[cst_1]] overflow<nsw, nuw> : vector<2xindex>
1648+ # CHECK: %[[D9:.*]] = arith.cmpi slt, %[[D8]], %[[cst_0]] : vector<2xindex>
16581649 # CHECK-COUNT-2: vector.maskedload %{{.*}}[%{{.*}}], %[[D9]]
16591650
16601651
0 commit comments