Skip to content

Commit fd3df28

Browse files
committed
Add block comments, simplify names
1 parent 0107f4a commit fd3df28

File tree

1 file changed

+31
-10
lines changed

1 file changed

+31
-10
lines changed

mlir/test/Dialect/Linalg/hoisting.mlir

Lines changed: 31 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,18 @@
11
// RUN: mlir-opt -transform-interpreter -canonicalize --split-input-file --allow-unregistered-dialect %s | FileCheck %s
22

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
411
// CHECK-SAME: %[[MEM:[a-zA-Z0-9]+]]: memref<?x?xf32>,
512
// CHECK-SAME: %[[LB:[a-zA-Z0-9]+]]: index,
613
// CHECK-SAME: %[[UB:[a-zA-Z0-9]+]]: index,
714
// 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) {
916
%pad = arith.constant 0.0 : f32
1017

1118
// CHECK: %[[PAD:.*]] = arith.constant 0.000000e+00 : f32
@@ -41,12 +48,12 @@ module attributes {transform.with_named_sequence} {
4148

4249
// -----
4350

44-
// CHECK-LABEL: func @xfer_pair_double_loop_mem_use_inside_outer_loop
51+
// CHECK-LABEL: func @mem_use_inside_outer_loop
4552
// CHECK-SAME: %[[MEM:[a-zA-Z0-9]+]]: memref<?x?xf32>,
4653
// CHECK-SAME: %[[LB:[a-zA-Z0-9]+]]: index,
4754
// CHECK-SAME: %[[UB:[a-zA-Z0-9]+]]: index,
4855
// 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) {
5057
%pad = arith.constant 0.0 : f32
5158

5259
// CHECK: %[[PAD:.*]] = arith.constant 0.000000e+00 : f32
@@ -82,12 +89,19 @@ module attributes {transform.with_named_sequence} {
8289

8390
// -----
8491

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
86100
// CHECK-SAME: %[[MEM:[a-zA-Z0-9]+]]: memref<?x?xf32>,
87101
// CHECK-SAME: %[[LB:[a-zA-Z0-9]+]]: index,
88102
// CHECK-SAME: %[[UB:[a-zA-Z0-9]+]]: index,
89103
// 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) {
91105
%c0 = arith.constant 0 : index
92106
%pad = arith.constant 0.0 : f32
93107

@@ -124,12 +138,12 @@ module attributes {transform.with_named_sequence} {
124138

125139
// -----
126140

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
128142
// CHECK-SAME: %[[MEM:[a-zA-Z0-9]+]]: memref<?x?xf32>,
129143
// CHECK-SAME: %[[LB:[a-zA-Z0-9]+]]: index,
130144
// CHECK-SAME: %[[UB:[a-zA-Z0-9]+]]: index,
131145
// 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) {
133147
%c0 = arith.constant 0 : index
134148
%pad = arith.constant 0.0 : f32
135149

@@ -166,12 +180,12 @@ module attributes {transform.with_named_sequence} {
166180

167181
// -----
168182

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
170184
// CHECK-SAME: %[[MEM:[a-zA-Z0-9]+]]: memref<?x?xf32>,
171185
// CHECK-SAME: %[[LB:[a-zA-Z0-9]+]]: index,
172186
// CHECK-SAME: %[[UB:[a-zA-Z0-9]+]]: index,
173187
// 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) {
175189
%c0 = arith.constant 0 : index
176190
%pad = arith.constant 0.0 : f32
177191

@@ -206,6 +220,13 @@ module attributes {transform.with_named_sequence} {
206220

207221
// -----
208222

223+
///----------------------------------------------------------------------------------------
224+
/// Other tests
225+
///
226+
/// TODO: Document
227+
///----------------------------------------------------------------------------------------
228+
229+
209230
// CHECK-LABEL: func @hoist_vector_transfer_pairs_disjoint(
210231
// CHECK-SAME: %[[MEMREF0:[a-zA-Z0-9]*]]: memref<?x?xf32>,
211232
// CHECK-SAME: %[[MEMREF1:[a-zA-Z0-9]*]]: memref<?x?xf32>,

0 commit comments

Comments
 (0)