Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
d661413
[mlir][vector] Add support for lowering n-D vector.to_elements op.
hanhanW Sep 5, 2025
edf4019
Add new populate patterns for flattening.
amd-eochoalo Sep 5, 2025
12fd6fc
[mlir][vector] Add function to unroll vectors.
amd-eochoalo Sep 5, 2025
0415e3b
[mlir][vector] Add vector.to_elements unrolling.
amd-eochoalo Sep 5, 2025
1b21117
Split tests for unrolling and flattening to elements
amd-eochoalo Sep 5, 2025
567af4b
Fix test
amd-eochoalo Sep 5, 2025
c58b5c4
Address review comments
amd-eochoalo Sep 5, 2025
871f5a5
Remove unnecessary comment
amd-eochoalo Sep 5, 2025
244eed5
Address review comments
amd-eochoalo Sep 5, 2025
9933387
Add comment
amd-eochoalo Sep 9, 2025
351086b
Disable and move vector flattening
amd-eochoalo Sep 9, 2025
9f7d15d
Re-enable and rename flattening to linearize
amd-eochoalo Sep 9, 2025
a8f9b9c
Remove LinearizeToElements
amd-eochoalo Sep 9, 2025
0568cba
Improve API of unrollVectorValue.
amd-eochoalo Sep 10, 2025
00cc94b
Documentation
amd-eochoalo Sep 10, 2025
6894af0
Add transform.apply_patterns.vector.unroll_to_elements
amd-eochoalo Sep 10, 2025
82004a2
Minor changes
amd-eochoalo Sep 10, 2025
cb6cf99
Remove comment and use inline storage for SmallVector
amd-eochoalo Sep 11, 2025
db83d2f
Add test with transform interpreter
amd-eochoalo Sep 11, 2025
ccec33c
Use transform dialect library file
amd-eochoalo Sep 11, 2025
ecca0d0
Merge branch 'main' into eochoa/2025-09-05/vector-to-elements-lowering
amd-eochoalo Sep 11, 2025
7e52d00
Update mlir/test/Dialect/Vector/lit.local.cfg
amd-eochoalo Sep 11, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,7 @@ struct UnrollToElements final : public OpRewritePattern<vector::ToElementsOp> {
}
SmallVector<Value> vectors = *result;

// May be a large vector.
SmallVector<Value, 0> results;
SmallVector<Value> results;
for (const Value &vector : vectors) {
auto subElements =
vector::ToElementsOp::create(rewriter, op.getLoc(), vector);
Expand Down
2 changes: 2 additions & 0 deletions mlir/test/Dialect/Vector/lit.local.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Skip the directory with input TD sequences
config.excludes = ["td"]
11 changes: 11 additions & 0 deletions mlir/test/Dialect/Vector/td/unroll-elements.mlir
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
module attributes {transform.with_named_sequence} {
transform.named_sequence @unroll_to_elements(%module_op: !transform.any_op {transform.readonly}) {
%f = transform.structured.match ops{["func.func"]} in %module_op
: (!transform.any_op) -> !transform.any_op
transform.apply_patterns to %f {
transform.apply_patterns.vector.transfer_permutation_patterns
transform.apply_patterns.vector.unroll_to_elements
} : !transform.any_op
transform.yield
}
}
2 changes: 2 additions & 0 deletions mlir/test/Dialect/Vector/vector-to-elements-lowering.mlir
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
// RUN: mlir-opt %s -test-unroll-vector-to-elements -split-input-file | FileCheck %s
// RUN: mlir-opt %s -transform-preload-library='transform-library-paths=%p/td/unroll-elements.mlir' \
// RUN: -transform-interpreter=entry-point=unroll_to_elements | FileCheck %s

// CHECK-LABEL: func.func @to_elements_1d(
// CHECK-SAME: %[[ARG0:.+]]: vector<2xf32>
Expand Down
Loading