@@ -388,19 +388,17 @@ func.func @vector_load_2D(%mem: memref<4x4xf16>) -> vector<4x4xf16> {
388388
389389// CHECK-LABEL: func.func @vector_load_2D(
390390// CHECK-SAME: %[[ARG:.*]]: memref<4x4xf16>) -> vector<4x4xf16> {
391- // CHECK: %[[C3:.*]] = arith.constant 3 : index
392391 // CHECK: %[[C2:.*]] = arith.constant 2 : index
393- // CHECK: %[[C1:.*]] = arith.constant 1 : index
394392 // CHECK: %[[C0:.*]] = arith.constant 0 : index
395393 // CHECK: %[[CST:.*]] = arith.constant dense<0.000000e+00> : vector<4x4xf16>
396- // CHECK: %[[V0:.*]] = vector.load %[[ARG]][%[[C0]], %[[C0]]] : memref<4x4xf16>, vector<4xf16 >
397- // CHECK: %[[V1:.*]] = vector.insert_strided_slice %[[V0]], %[[CST]] {offsets = [0, 0], strides = [1]} : vector<4xf16 > into vector<4x4xf16>
398- // CHECK: %[[V2:.*]] = vector.load %[[ARG]][%[[C1 ]], %[[C0 ]]] : memref<4x4xf16>, vector<4xf16 >
399- // CHECK: %[[V3:.*]] = vector.insert_strided_slice %[[V2]], %[[V1]] {offsets = [1, 0 ], strides = [1]} : vector<4xf16 > into vector<4x4xf16>
400- // CHECK: %[[V4:.*]] = vector.load %[[ARG]][%[[C2]], %[[C0]]] : memref<4x4xf16>, vector<4xf16 >
401- // CHECK: %[[V5:.*]] = vector.insert_strided_slice %[[V4]], %[[V3]] {offsets = [2, 0], strides = [1]} : vector<4xf16 > into vector<4x4xf16>
402- // CHECK: %[[V6:.*]] = vector.load %[[ARG]][%[[C3 ]], %[[C0 ]]] : memref<4x4xf16>, vector<4xf16 >
403- // CHECK: %[[V7:.*]] = vector.insert_strided_slice %[[V6]], %[[V5]] {offsets = [3, 0 ], strides = [1]} : vector<4xf16 > into vector<4x4xf16>
394+ // CHECK: %[[V0:.*]] = vector.load %[[ARG]][%[[C0]], %[[C0]]] : memref<4x4xf16>, vector<2x2xf16 >
395+ // CHECK: %[[V1:.*]] = vector.insert_strided_slice %[[V0]], %[[CST]] {offsets = [0, 0], strides = [1, 1 ]} : vector<2x2xf16 > into vector<4x4xf16>
396+ // CHECK: %[[V2:.*]] = vector.load %[[ARG]][%[[C0 ]], %[[C2 ]]] : memref<4x4xf16>, vector<2x2xf16 >
397+ // CHECK: %[[V3:.*]] = vector.insert_strided_slice %[[V2]], %[[V1]] {offsets = [0, 2 ], strides = [1, 1 ]} : vector<2x2xf16 > into vector<4x4xf16>
398+ // CHECK: %[[V4:.*]] = vector.load %[[ARG]][%[[C2]], %[[C0]]] : memref<4x4xf16>, vector<2x2xf16 >
399+ // CHECK: %[[V5:.*]] = vector.insert_strided_slice %[[V4]], %[[V3]] {offsets = [2, 0], strides = [1, 1 ]} : vector<2x2xf16 > into vector<4x4xf16>
400+ // CHECK: %[[V6:.*]] = vector.load %[[ARG]][%[[C2 ]], %[[C2 ]]] : memref<4x4xf16>, vector<2x2xf16 >
401+ // CHECK: %[[V7:.*]] = vector.insert_strided_slice %[[V6]], %[[V5]] {offsets = [2, 2 ], strides = [1, 1 ]} : vector<2x2xf16 > into vector<4x4xf16>
404402 // CHECK: return %[[V7]] : vector<4x4xf16>
405403
406404
@@ -412,48 +410,13 @@ func.func @vector_store_2D(%mem: memref<4x4xf16>, %v: vector<4x4xf16>) {
412410
413411// CHECK-LABEL: func.func @vector_store_2D(
414412// CHECK-SAME: %[[ARG0:.*]]: memref<4x4xf16>, %[[ARG1:.*]]: vector<4x4xf16>) {
415- // CHECK: %[[C3:.*]] = arith.constant 3 : index
416413 // CHECK: %[[C2:.*]] = arith.constant 2 : index
417- // CHECK: %[[C1:.*]] = arith.constant 1 : index
418414 // CHECK: %[[C0:.*]] = arith.constant 0 : index
419- // CHECK: %[[V0:.*]] = vector.extract %[[ARG1]][0] : vector<4xf16> from vector<4x4xf16>
420- // CHECK: vector.store %[[V0]], %[[ARG0]][%[[C0]], %[[C0]]] : memref<4x4xf16>, vector<4xf16>
421- // CHECK: %[[V1:.*]] = vector.extract %[[ARG1]][1] : vector<4xf16> from vector<4x4xf16>
422- // CHECK: vector.store %[[V1]], %[[ARG0]][%[[C1]], %[[C0]]] : memref<4x4xf16>, vector<4xf16>
423- // CHECK: %[[V2:.*]] = vector.extract %[[ARG1]][2] : vector<4xf16> from vector<4x4xf16>
424- // CHECK: vector.store %[[V2]], %[[ARG0]][%[[C2]], %[[C0]]] : memref<4x4xf16>, vector<4xf16>
425- // CHECK: %[[V3:.*]] = vector.extract %[[ARG1]][3] : vector<4xf16> from vector<4x4xf16>
426- // CHECK: vector.store %[[V3]], %[[ARG0]][%[[C3]], %[[C0]]] : memref<4x4xf16>, vector<4xf16>
427-
428-
429- func.func @vector_load_4D_to_2D (%mem: memref <4 x4 x4 x4 xf16 >) -> vector <2 x2 xf16 > {
430- %c1 = arith.constant 1 : index
431- %0 = vector.load %mem [%c1 , %c1 , %c1 , %c1 ] : memref <4 x4 x4 x4 xf16 >, vector <2 x2 xf16 >
432- return %0 : vector <2 x2 xf16 >
433- }
434-
435- // CHECK-LABEL: func.func @vector_load_4D_to_2D(
436- // CHECK-SAME: %[[ARG:.*]]: memref<4x4x4x4xf16>) -> vector<2x2xf16> {
437- // CHECK: %[[C2:.*]] = arith.constant 2 : index
438- // CHECK: %[[C1:.*]] = arith.constant 1 : index
439- // CHECK: %[[CST:.*]] = arith.constant dense<0.000000e+00> : vector<2x2xf16>
440- // CHECK: %[[V0:.*]] = vector.load %[[ARG]][%[[C1]], %[[C1]], %[[C1]], %[[C1]]] : memref<4x4x4x4xf16>, vector<2xf16>
441- // CHECK: %[[V1:.*]] = vector.insert_strided_slice %[[V0]], %[[CST]] {offsets = [0, 0], strides = [1]} : vector<2xf16> into vector<2x2xf16>
442- // CHECK: %[[V2:.*]] = vector.load %[[ARG]][%[[C1]], %[[C1]], %[[C2]], %[[C1]]] : memref<4x4x4x4xf16>, vector<2xf16>
443- // CHECK: %[[V3:.*]] = vector.insert_strided_slice %[[V2]], %[[V1]] {offsets = [1, 0], strides = [1]} : vector<2xf16> into vector<2x2xf16>
444- // CHECK: return %[[V3]] : vector<2x2xf16>
445-
446- func.func @vector_store_2D_to_4D (%mem: memref <4 x4 x4 x4 xf16 >, %v: vector <2 x2 xf16 >) {
447- %c1 = arith.constant 1 : index
448- vector.store %v , %mem [%c1 , %c1 , %c1 , %c1 ] : memref <4 x4 x4 x4 xf16 >, vector <2 x2 xf16 >
449- return
450- }
451-
452- // CHECK-LABEL: func.func @vector_store_2D_to_4D(
453- // CHECK-SAME: %[[ARG0:.*]]: memref<4x4x4x4xf16>, %[[ARG1:.*]]: vector<2x2xf16>) {
454- // CHECK: %[[C2:.*]] = arith.constant 2 : index
455- // CHECK: %[[C1:.*]] = arith.constant 1 : index
456- // CHECK: %[[V0:.*]] = vector.extract %[[ARG1]][0] : vector<2xf16> from vector<2x2xf16>
457- // CHECK: vector.store %[[V0]], %[[ARG0]][%[[C1]], %[[C1]], %[[C1]], %[[C1]]] : memref<4x4x4x4xf16>, vector<2xf16>
458- // CHECK: %[[V1:.*]] = vector.extract %[[ARG1]][1] : vector<2xf16> from vector<2x2xf16>
459- // CHECK: vector.store %[[V1]], %[[ARG0]][%[[C1]], %[[C1]], %[[C2]], %[[C1]]] : memref<4x4x4x4xf16>, vector<2xf16>
415+ // CHECK: %[[V0:.*]] = vector.extract_strided_slice %[[ARG1]] {offsets = [0, 0], sizes = [2, 2], strides = [1, 1]} : vector<4x4xf16> to vector<2x2xf16>
416+ // CHECK: vector.store %[[V0]], %[[ARG0]][%[[C0]], %[[C0]]] : memref<4x4xf16>, vector<2x2xf16>
417+ // CHECK: %[[V1:.*]] = vector.extract_strided_slice %[[ARG1]] {offsets = [0, 2], sizes = [2, 2], strides = [1, 1]} : vector<4x4xf16> to vector<2x2xf16>
418+ // CHECK: vector.store %[[V1]], %[[ARG0]][%[[C0]], %[[C2]]] : memref<4x4xf16>, vector<2x2xf16>
419+ // CHECK: %[[V2:.*]] = vector.extract_strided_slice %[[ARG1]] {offsets = [2, 0], sizes = [2, 2], strides = [1, 1]} : vector<4x4xf16> to vector<2x2xf16>
420+ // CHECK: vector.store %[[V2]], %[[ARG0]][%[[C2]], %[[C0]]] : memref<4x4xf16>, vector<2x2xf16>
421+ // CHECK: %[[V3:.*]] = vector.extract_strided_slice %[[ARG1]] {offsets = [2, 2], sizes = [2, 2], strides = [1, 1]} : vector<4x4xf16> to vector<2x2xf16>
422+ // CHECK: vector.store %[[V3]], %[[ARG0]][%[[C2]], %[[C2]]] : memref<4x4xf16>, vector<2x2xf16>
0 commit comments