|
1 | 1 | // RUN: mlir-opt -transform-interpreter -canonicalize --split-input-file --allow-unregistered-dialect %s | FileCheck %s
|
2 | 2 |
|
3 |
| -// CHECK-LABEL: func @xfer_pair_double_loop_mem_use_outside |
| 3 | +///---------------------------------------------------------------------------------------- |
| 4 | +/// Tests for vector.transfer_read + vector.transfer_write pairs |
| 5 | +/// |
| 6 | +/// * Nested in double loops |
| 7 | +// * Indices depend on induction variables |
| 8 | +///---------------------------------------------------------------------------------------- |
| 9 | + |
| 10 | +// CHECK-LABEL: func @mem_use_outside |
4 | 11 | // CHECK-SAME: %[[MEM:[a-zA-Z0-9]+]]: memref<?x?xf32>,
|
5 | 12 | // CHECK-SAME: %[[LB:[a-zA-Z0-9]+]]: index,
|
6 | 13 | // CHECK-SAME: %[[UB:[a-zA-Z0-9]+]]: index,
|
7 | 14 | // CHECK-SAME: %[[STEP:[a-zA-Z0-9]+]]: index)
|
8 |
| -func.func @xfer_pair_double_loop_mem_use_outside(%mem: memref<?x?xf32>, %lb : index, %ub : index, %step: index) { |
| 15 | +func.func @mem_use_outside(%mem: memref<?x?xf32>, %lb : index, %ub : index, %step: index) { |
9 | 16 | %pad = arith.constant 0.0 : f32
|
10 | 17 |
|
11 | 18 | // CHECK: %[[PAD:.*]] = arith.constant 0.000000e+00 : f32
|
@@ -41,12 +48,12 @@ module attributes {transform.with_named_sequence} {
|
41 | 48 |
|
42 | 49 | // -----
|
43 | 50 |
|
44 |
| -// CHECK-LABEL: func @xfer_pair_double_loop_mem_use_inside_outer_loop |
| 51 | +// CHECK-LABEL: func @mem_use_inside_outer_loop |
45 | 52 | // CHECK-SAME: %[[MEM:[a-zA-Z0-9]+]]: memref<?x?xf32>,
|
46 | 53 | // CHECK-SAME: %[[LB:[a-zA-Z0-9]+]]: index,
|
47 | 54 | // CHECK-SAME: %[[UB:[a-zA-Z0-9]+]]: index,
|
48 | 55 | // CHECK-SAME: %[[STEP:[a-zA-Z0-9]+]]: index)
|
49 |
| -func.func @xfer_pair_double_loop_mem_use_inside_outer_loop(%mem: memref<?x?xf32>, %lb : index, %ub : index, %step: index) { |
| 56 | +func.func @mem_use_inside_outer_loop(%mem: memref<?x?xf32>, %lb : index, %ub : index, %step: index) { |
50 | 57 | %pad = arith.constant 0.0 : f32
|
51 | 58 |
|
52 | 59 | // CHECK: %[[PAD:.*]] = arith.constant 0.000000e+00 : f32
|
@@ -82,12 +89,19 @@ module attributes {transform.with_named_sequence} {
|
82 | 89 |
|
83 | 90 | // -----
|
84 | 91 |
|
85 |
| -// CHECK-LABEL: func @negative_xfer_pair_double_loop_mem_use_inside_inner_loop_before_write |
| 92 | +///---------------------------------------------------------------------------------------- |
| 93 | +/// Tests for vector.transfer_read + vector.transfer_write pairs |
| 94 | +/// |
| 95 | +/// * Nested in double loops |
| 96 | +// * Indices are constant |
| 97 | +///---------------------------------------------------------------------------------------- |
| 98 | + |
| 99 | +// CHECK-LABEL: func @negative_mem_use_inside_inner_loop_before_write |
86 | 100 | // CHECK-SAME: %[[MEM:[a-zA-Z0-9]+]]: memref<?x?xf32>,
|
87 | 101 | // CHECK-SAME: %[[LB:[a-zA-Z0-9]+]]: index,
|
88 | 102 | // CHECK-SAME: %[[UB:[a-zA-Z0-9]+]]: index,
|
89 | 103 | // CHECK-SAME: %[[STEP:[a-zA-Z0-9]+]]: index)
|
90 |
| -func.func @negative_xfer_pair_double_loop_mem_use_inside_inner_loop_before_write(%mem: memref<?x?xf32>, %lb : index, %ub : index, %step: index) { |
| 104 | +func.func @negative_mem_use_inside_inner_loop_before_write(%mem: memref<?x?xf32>, %lb : index, %ub : index, %step: index) { |
91 | 105 | %c0 = arith.constant 0 : index
|
92 | 106 | %pad = arith.constant 0.0 : f32
|
93 | 107 |
|
@@ -124,12 +138,12 @@ module attributes {transform.with_named_sequence} {
|
124 | 138 |
|
125 | 139 | // -----
|
126 | 140 |
|
127 |
| -// CHECK-LABEL: func @negative_xfer_pair_double_loop_mem_use_inside_inner_loop_after_write |
| 141 | +// CHECK-LABEL: func @negative_mem_use_inside_inner_loop_after_write |
128 | 142 | // CHECK-SAME: %[[MEM:[a-zA-Z0-9]+]]: memref<?x?xf32>,
|
129 | 143 | // CHECK-SAME: %[[LB:[a-zA-Z0-9]+]]: index,
|
130 | 144 | // CHECK-SAME: %[[UB:[a-zA-Z0-9]+]]: index,
|
131 | 145 | // CHECK-SAME: %[[STEP:[a-zA-Z0-9]+]]: index)
|
132 |
| -func.func @negative_xfer_pair_double_loop_mem_use_inside_inner_loop_after_write(%mem: memref<?x?xf32>, %lb : index, %ub : index, %step: index) { |
| 146 | +func.func @negative_mem_use_inside_inner_loop_after_write(%mem: memref<?x?xf32>, %lb : index, %ub : index, %step: index) { |
133 | 147 | %c0 = arith.constant 0 : index
|
134 | 148 | %pad = arith.constant 0.0 : f32
|
135 | 149 |
|
@@ -166,12 +180,12 @@ module attributes {transform.with_named_sequence} {
|
166 | 180 |
|
167 | 181 | // -----
|
168 | 182 |
|
169 |
| -// CHECK-LABEL: func @negative_xfer_pair_double_loop_mem_use_inside_inner_loop_before_read |
| 183 | +// CHECK-LABEL: func @negative_mem_use_inside_inner_loop_before_read |
170 | 184 | // CHECK-SAME: %[[MEM:[a-zA-Z0-9]+]]: memref<?x?xf32>,
|
171 | 185 | // CHECK-SAME: %[[LB:[a-zA-Z0-9]+]]: index,
|
172 | 186 | // CHECK-SAME: %[[UB:[a-zA-Z0-9]+]]: index,
|
173 | 187 | // CHECK-SAME: %[[STEP:[a-zA-Z0-9]+]]: index)
|
174 |
| -func.func @negative_xfer_pair_double_loop_mem_use_inside_inner_loop_before_read(%mem: memref<?x?xf32>, %lb : index, %ub : index, %step: index) { |
| 188 | +func.func @negative_mem_use_inside_inner_loop_before_read(%mem: memref<?x?xf32>, %lb : index, %ub : index, %step: index) { |
175 | 189 | %c0 = arith.constant 0 : index
|
176 | 190 | %pad = arith.constant 0.0 : f32
|
177 | 191 |
|
@@ -206,6 +220,13 @@ module attributes {transform.with_named_sequence} {
|
206 | 220 |
|
207 | 221 | // -----
|
208 | 222 |
|
| 223 | +///---------------------------------------------------------------------------------------- |
| 224 | +/// Other tests |
| 225 | +/// |
| 226 | +/// TODO: Document |
| 227 | +///---------------------------------------------------------------------------------------- |
| 228 | + |
| 229 | + |
209 | 230 | // CHECK-LABEL: func @hoist_vector_transfer_pairs_disjoint(
|
210 | 231 | // CHECK-SAME: %[[MEMREF0:[a-zA-Z0-9]*]]: memref<?x?xf32>,
|
211 | 232 | // CHECK-SAME: %[[MEMREF1:[a-zA-Z0-9]*]]: memref<?x?xf32>,
|
|
0 commit comments