diff options
| author | Chao Chen <chao.chen@intel.com> | 2025-06-05 12:42:16 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-06-05 12:42:16 -0500 |
| commit | def37f7e3a66601e044ce49c034293e7e32d2a3b (patch) | |
| tree | 4228cbdefd7f2fcf180d4da793f0179fa7bf1be8 /mlir/test/lib/Dialect/Vector/TestVectorTransforms.cpp | |
| parent | 4dcc159485e6b1ece15982dfe17656c8f9f11779 (diff) | |
[mlir][vector] add unroll pattern for broadcast (#142011)
This PR adds `UnrollBroadcastPattern` to `VectorUnroll` transform.
To support this, it also extends `BroadcastOp` definition with
`VectorUnrollOpInterface`
Diffstat (limited to 'mlir/test/lib/Dialect/Vector/TestVectorTransforms.cpp')
| -rw-r--r-- | mlir/test/lib/Dialect/Vector/TestVectorTransforms.cpp | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/mlir/test/lib/Dialect/Vector/TestVectorTransforms.cpp b/mlir/test/lib/Dialect/Vector/TestVectorTransforms.cpp index f4f32e933987..54aa96ba89a0 100644 --- a/mlir/test/lib/Dialect/Vector/TestVectorTransforms.cpp +++ b/mlir/test/lib/Dialect/Vector/TestVectorTransforms.cpp @@ -157,12 +157,14 @@ struct TestVectorUnrollingPatterns MLIRContext *ctx = &getContext(); RewritePatternSet patterns(ctx); populateVectorUnrollPatterns( - patterns, UnrollVectorOptions() - .setNativeShape(ArrayRef<int64_t>{2, 2}) - .setFilterConstraint([](Operation *op) { - return success(isa<arith::AddFOp, vector::FMAOp, - vector::MultiDimReductionOp>(op)); - })); + patterns, + UnrollVectorOptions() + .setNativeShape(ArrayRef<int64_t>{2, 2}) + .setFilterConstraint([](Operation *op) { + return success( + isa<arith::AddFOp, vector::FMAOp, vector::MultiDimReductionOp, + vector::BroadcastOp>(op)); + })); populateVectorUnrollPatterns( patterns, UnrollVectorOptions() .setNativeShape(ArrayRef<int64_t>{2}) |
