Skip to content

[mlir][SME] Update E2E test to show potential optimisation (NFC) #107585

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Sep 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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 @@ -82,8 +82,16 @@ module attributes {transform.with_named_sequence} {
transform.apply_patterns to %func {
transform.apply_patterns.vector.lower_contraction lowering_strategy = "outerproduct"
transform.apply_patterns.vector.lower_masks
transform.apply_patterns.canonicalization
} : !transform.any_op

// Step 5 (optional optimization): Hoist accumulator load/store.
%func_h = transform.structured.hoist_redundant_vector_transfers %func
: (!transform.any_op) -> !transform.any_op
%all_loops = transform.structured.match interface{LoopLikeInterface} in %module
: (!transform.any_op) -> !transform.any_op
transform.apply_licm to %all_loops : !transform.any_op
transform.loop.hoist_loop_invariant_subsets %all_loops : !transform.any_op
transform.yield
}
}
Expand Down
8 changes: 8 additions & 0 deletions mlir/test/Integration/Dialect/Linalg/CPU/ArmSME/matmul.mlir
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,16 @@ module attributes {transform.with_named_sequence} {
transform.apply_patterns.vector.lower_contraction lowering_strategy = "outerproduct"
transform.apply_patterns.vector.lower_masks
transform.apply_patterns.vector.rank_reducing_subview_patterns
transform.apply_patterns.canonicalization
} : !transform.any_op

// Step 6 (optional optimization): Hoist accumulator load/store.
%func_h = transform.structured.hoist_redundant_vector_transfers %func
: (!transform.any_op) -> !transform.any_op
%all_loops = transform.structured.match interface{LoopLikeInterface} in %bufferize
: (!transform.any_op) -> !transform.any_op
transform.apply_licm to %all_loops : !transform.any_op
transform.loop.hoist_loop_invariant_subsets %all_loops : !transform.any_op
transform.yield
}
}
Expand Down
Loading