Skip to content

Commit dce5fb6

Browse files
committed
[mlir][linalg] Add vectorization to the e2e test for tensor.unpack
Following on from llvm#122927 + llvm#123031 that added support for masked vectorization of `tensor.insert_slice`, this PR extends the e2e test for `tensor.unpack` to leverage the new functionality.
1 parent 4e23f1b commit dce5fb6

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

mlir/test/Integration/Dialect/Linalg/CPU/pack-dynamic-inner-tile.mlir

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,11 +121,11 @@ module @transforms attributes { transform.with_named_sequence } {
121121
transform.apply_patterns.canonicalization
122122
} : !transform.op<"func.func">
123123

124-
// 3. Bufferize before lowering to LLVM
124+
// 4. Bufferize before lowering to LLVM
125125
%bufferize = transform.bufferization.one_shot_bufferize %module
126126
{bufferize_function_boundaries=true} : (!transform.any_op) -> !transform.any_op
127127

128-
// 4. Canonicalize
128+
// 5. Canonicalize
129129
%func_op_bufferized = transform.structured.match ops{["func.func"]} in %bufferize : (!transform.any_op) -> !transform.op<"func.func">
130130
transform.apply_patterns to %func_op_bufferized {
131131
transform.apply_patterns.canonicalization

mlir/test/Integration/Dialect/Linalg/CPU/unpack-dynamic-inner-tile.mlir

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// DEFINE: %{compile} = mlir-opt %s \
2-
// DEFINE: -transform-interpreter -test-transform-dialect-erase-schedule |\
2+
// DEFINE: -transform-interpreter -test-transform-dialect-erase-schedule \
3+
// DEFINE: --lower-vector-mask |\
34
// DEFINE: mlir-opt \
45
// DEFINE: -test-lower-to-llvm -o %t
56
// DEFINE: %{entry_point} = main
@@ -90,14 +91,19 @@ module @transforms attributes { transform.with_named_sequence } {
9091
%func_op = transform.get_parent_op %tiled_pack_op_p {isolated_from_above} : (!transform.any_op) -> !transform.op<"func.func">
9192
transform.apply_patterns to %func_op {
9293
transform.apply_patterns.linalg.decompose_pack_unpack
93-
transform.apply_patterns.linalg.decompose_pad
94+
transform.apply_patterns.canonicalization
9495
} : !transform.op<"func.func">
9596

97+
// 3. Vectorize tensor.insert_slice
98+
// Vector sizes match the inner tiles in the payload IR.
99+
%slice = transform.structured.match ops{["tensor.insert_slice"]} in %func_op : (!transform.op<"func.func">) -> !transform.any_op
100+
transform.structured.vectorize %slice vector_sizes [8, 1] : !transform.any_op
101+
96102
// 3. Bufferize before lowering to LLVM
97103
%bufferize = transform.bufferization.one_shot_bufferize %module
98104
{bufferize_function_boundaries=true} : (!transform.any_op) -> !transform.any_op
99105

100-
// 4. Canonicalize
106+
// 4. Canonicalize
101107
%func_op_bufferized = transform.structured.match ops{["func.func"]} in %bufferize : (!transform.any_op) -> !transform.op<"func.func">
102108
transform.apply_patterns to %func_op_bufferized {
103109
transform.apply_patterns.canonicalization

0 commit comments

Comments
 (0)