From e000b62a342cac907fd77cfdd070f0b055f0c3c4 Mon Sep 17 00:00:00 2001 From: Lei Zhang Date: Wed, 17 May 2023 08:57:13 -0700 Subject: [mlir][vector] Separate out vector transfer + tensor slice patterns These patterns touches the structure generated from tiling so it affects later steps like bufferization and vector hoisting. Instead of putting them in canonicalization, this commit creates separate entry points for them to be called explicitly. This is NFC regarding the functionality and tests of those patterns. It also addresses two TODO items in the codebase. Reviewed By: ThomasRaoux Differential Revision: https://reviews.llvm.org/D150702 --- .../lib/Dialect/Vector/TestVectorTransforms.cpp | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'mlir/test/lib/Dialect/Vector/TestVectorTransforms.cpp') diff --git a/mlir/test/lib/Dialect/Vector/TestVectorTransforms.cpp b/mlir/test/lib/Dialect/Vector/TestVectorTransforms.cpp index d0c79ab98915..50dfeff635cc 100644 --- a/mlir/test/lib/Dialect/Vector/TestVectorTransforms.cpp +++ b/mlir/test/lib/Dialect/Vector/TestVectorTransforms.cpp @@ -679,6 +679,26 @@ struct TestVectorGatherLowering } }; +struct TestVectorTransferTensorSlicePatterns + : public PassWrapper> { + MLIR_DEFINE_EXPLICIT_INTERNAL_INLINE_TYPE_ID( + TestVectorTransferTensorSlicePatterns) + + StringRef getArgument() const final { + return "test-vector-transfer-tensor-slice-patterns"; + } + StringRef getDescription() const final { + return "Test patterns that fold vector transfer and tensor slice ops"; + } + + void runOnOperation() override { + RewritePatternSet patterns(&getContext()); + populateVectorTransferTensorSliceTransforms(patterns); + (void)applyPatternsAndFoldGreedily(getOperation(), std::move(patterns)); + } +}; + } // namespace namespace mlir { @@ -713,6 +733,8 @@ void registerTestVectorLowerings() { PassRegistration(); PassRegistration(); + + PassRegistration(); } } // namespace test } // namespace mlir -- cgit v1.2.3