Skip to content

Commit

Permalink
[mlir][nfc] Update vectorize-tensor-extract.mlir (2/N) (llvm#119080)
Browse files Browse the repository at this point in the history
Tests in "vectorize-tensor-extract.mlir" are inconsistent and would
benefit from refactoring to:

* Clearly categorize tests into "contiguous load," "gather load," and
  "scalar load + broadcast" cases, reflecting the structure of
  tensor.extract vectorization.
* Unify variable naming (both MLIR and FileCheck).
* Ensure all tests exercise unmasked vectorization (masked vectorization
  is covered in "vectorize-tensor-extract-masked.mlir").
* Improve and standardize formatting.

These changes will make it easier to identify the test cases being
exercised and simplify future maintenance or refactoring.

This is patch 2/N in the series; below is a summary of the specific
changes
in this patch.

----------------------------------------------------------------------
Summary of patch 2/N
----------------------------------------------------------------------

Makes all tests re-use the same TD sequence. This TD sequence has been
extracted to a deducted file:
  * "td/vectorize-with-patterns.mlir".

----------------------------------------------------------------------
 Previous patches:
----------------------------------------------------------------------

* llvm#118977
  • Loading branch information
banach-space authored Dec 11, 2024
1 parent 1bc1703 commit 796a1cf
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 196 deletions.
10 changes: 10 additions & 0 deletions mlir/test/Dialect/Linalg/td/vectorize-with-patterns.mlir
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
module @transforms attributes { transform.with_named_sequence } {
transform.named_sequence @vectorize_with_patterns(%module: !transform.any_op {transform.readonly}) {

%0 = transform.structured.match ops{["linalg.generic"]} in %module : (!transform.any_op) -> !transform.any_op
%1 = transform.get_parent_op %0 {isolated_from_above} : (!transform.any_op) -> !transform.any_op
%2 = transform.structured.vectorize_children_and_apply_patterns %1 { vectorize_nd_extract } : (!transform.any_op) -> !transform.any_op

transform.yield
}
}
Loading

0 comments on commit 796a1cf

Please sign in to comment.