@@ -136,7 +136,9 @@ func.func @vectorize_nd_tensor_extract_transfer_read_basic(
136
136
// CHECK: %[[READ:.*]] = vector.transfer_read %[[ARG0]][%[[IDX1]], %[[IDX2]], %[[C0:.*]]], %[[CST_0]] {in_bounds = [true, true, true]} : tensor<3x3x3xf32>, vector<1x1x3xf32>
137
137
// CHECK: vector.transfer_write %[[READ]], %[[ARG1]][%[[C0]], %[[C0]], %[[C0]]] {in_bounds = [true, true, true]} : vector<1x1x3xf32>, tensor<1x1x3xf32>
138
138
139
- // Same as example above, but reading into a column tensor.
139
+ // Same as example above, but reading into a column tensor. Note that after the
140
+ // vectorizatoin, the `TransferOpReduceRank` will replace
141
+ // `vector.transfer_read` with `tensor.extract -> scalar`.
140
142
141
143
// TODO: Currently this fails to vectorise when the indices are non-constant.
142
144
@@ -160,10 +162,9 @@ func.func @vectorize_nd_tensor_extract_transfer_read_basic_column(
160
162
// CHECK-LABEL: func.func @vectorize_nd_tensor_extract_transfer_read_basic_column(
161
163
// CHECK-SAME: %[[INPUT:.*]]: tensor<3x3x3xf32>,
162
164
// CHECK-SAME: %[[OUTPUT:.*]]: tensor<3x1x1xf32>)
163
- // CHECK-DAG: %[[C0:.*]] = arith.constant 0 : index
164
- // CHECK-DAG: %[[CST_0:.*]] = arith.constant 0.000000e+00 : f32
165
- // CHECK: %[[READ:.*]] = vector.transfer_read %[[INPUT]]{{\[}}%[[C0]], %[[C0]], %[[C0]]], %[[CST_0]] : tensor<3x3x3xf32>, vector<f32>
166
- // CHECK: %[[BCAST:.*]] = vector.broadcast %[[READ]] : vector<f32> to vector<3x1x1xf32>
165
+ // CHECK: %[[C0:.*]] = arith.constant 0 : index
166
+ // CHECK: %[[EXTRACT:.*]] = tensor.extract %[[INPUT]]{{\[}}%[[C0]], %[[C0]], %[[C0]]] : tensor<3x3x3xf32>
167
+ // CHECK: %[[BCAST:.*]] = vector.broadcast %[[EXTRACT]] : f32 to vector<3x1x1xf32>
167
168
// CHECK: %[[RES:.*]] = vector.transfer_write %[[BCAST]], %[[OUTPUT]]{{\[}}%[[C0]], %[[C0]], %[[C0]]] {in_bounds = [true, true, true]} : vector<3x1x1xf32>, tensor<3x1x1xf32>
168
169
// CHECK: return %[[RES]] : tensor<3x1x1xf32>
169
170
0 commit comments