-
Notifications
You must be signed in to change notification settings - Fork 11.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[mlir][Vector] Add a LowerVectorsOp to VectorTransformOps
This op significantly improves transfor dialect usage when using vector abstractions. It also brings us closer to writing simple end-to-end unit tests that guard against subtle regressions in how patterns combine. Differential Revision: https://reviews.llvm.org/D138723
- Loading branch information
1 parent
c757780
commit 6ff1233
Showing
5 changed files
with
185 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
// RUN: mlir-opt %s --test-transform-dialect-interpreter --split-input-file | FileCheck %s | ||
|
||
// CHECK-LABEL: func @matmul_tensors | ||
func.func @matmul_tensors( | ||
%arg0: tensor<8x16xf32>, %arg1: tensor<16x32xf32>, %arg2: tensor<8x32xf32>) | ||
-> tensor<8x32xf32> { | ||
// CHECK-NOT: linalg | ||
// CHECK: vector.extract {{.*}} : vector<8x4xf32> | ||
// CHECK: vector.store {{.*}} : memref<8x32xf32>, vector<4xf32> | ||
%0 = linalg.matmul ins(%arg0, %arg1: tensor<8x16xf32>, tensor<16x32xf32>) | ||
outs(%arg2: tensor<8x32xf32>) | ||
-> tensor<8x32xf32> | ||
return %0 : tensor<8x32xf32> | ||
} | ||
|
||
transform.sequence failures(propagate) { | ||
^bb1(%module_op: !pdl.operation): | ||
%0 = transform.structured.match ops{["linalg.matmul"]} in %module_op | ||
%1, %loops:3 = transform.structured.tile %0 [8, 4, 2] | ||
%2 = get_closest_isolated_parent %1 : (!pdl.operation) -> !pdl.operation | ||
transform.structured.vectorize %2 | ||
transform.bufferization.one_shot_bufferize %module_op | ||
|
||
%func = transform.structured.match ops{["func.func"]} in %module_op | ||
transform.vector.lower_vectors %func { multireduction_lowering = "innerreduce"} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters