diff --git a/mlir/include/mlir/Dialect/Vector/CMakeLists.txt b/mlir/include/mlir/Dialect/Vector/CMakeLists.txt --- a/mlir/include/mlir/Dialect/Vector/CMakeLists.txt +++ b/mlir/include/mlir/Dialect/Vector/CMakeLists.txt @@ -1,6 +1,2 @@ add_mlir_dialect(VectorOps vector) add_mlir_doc(VectorOps -gen-op-doc VectorOps Dialects/) - -set(LLVM_TARGET_DEFINITIONS VectorTransformPatterns.td) -mlir_tablegen(VectorTransformPatterns.h.inc -gen-rewriters) -add_public_tablegen_target(MLIRVectorTransformPatternsIncGen) diff --git a/mlir/include/mlir/Dialect/Vector/VectorTransformPatterns.td b/mlir/include/mlir/Dialect/Vector/VectorTransformPatterns.td deleted file mode 100644 --- a/mlir/include/mlir/Dialect/Vector/VectorTransformPatterns.td +++ /dev/null @@ -1,26 +0,0 @@ -//===- VectorTransformPatterns.td - Vector-Vector patterns -*- tablegen -*-===// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// -// -// This is the pattern definition file for declarative Vector transformations. -// -//===----------------------------------------------------------------------===// - -#ifndef VECTOR_TRANSFORM_PATTERNS -#define VECTOR_TRANSFORM_PATTERNS - -include "mlir/IR/OpBase.td" - -class HasShape shape> : - CPred<"$0.getType().cast().hasStaticShape({" # - StrJoinInt.result # "})">; - -class UnrollVectorOp factors> : NativeCodeCall< - "unrollSingleResultVectorOp($_builder, $0.getDefiningOp(), " # - "{" # StrJoinInt.result # "})">; - -#endif // VECTOR_TRANSFORM_PATTERNS diff --git a/mlir/lib/Dialect/Vector/CMakeLists.txt b/mlir/lib/Dialect/Vector/CMakeLists.txt --- a/mlir/lib/Dialect/Vector/CMakeLists.txt +++ b/mlir/lib/Dialect/Vector/CMakeLists.txt @@ -9,7 +9,6 @@ DEPENDS MLIRVectorOpsIncGen - MLIRVectorTransformPatternsIncGen LINK_LIBS PUBLIC MLIREDSC diff --git a/mlir/test/lib/CMakeLists.txt b/mlir/test/lib/CMakeLists.txt --- a/mlir/test/lib/CMakeLists.txt +++ b/mlir/test/lib/CMakeLists.txt @@ -1,4 +1,3 @@ -add_subdirectory(DeclarativeTransforms) add_subdirectory(Dialect) add_subdirectory(IR) add_subdirectory(Pass) diff --git a/mlir/test/lib/DeclarativeTransforms/CMakeLists.txt b/mlir/test/lib/DeclarativeTransforms/CMakeLists.txt deleted file mode 100644 --- a/mlir/test/lib/DeclarativeTransforms/CMakeLists.txt +++ /dev/null @@ -1,3 +0,0 @@ -set(LLVM_TARGET_DEFINITIONS TestVectorTransformPatterns.td) -mlir_tablegen(TestVectorTransformPatterns.h.inc -gen-rewriters) -add_public_tablegen_target(MLIRTestVectorTransformPatternsIncGen) diff --git a/mlir/test/lib/DeclarativeTransforms/TestVectorTransformPatterns.td b/mlir/test/lib/DeclarativeTransforms/TestVectorTransformPatterns.td deleted file mode 100644 --- a/mlir/test/lib/DeclarativeTransforms/TestVectorTransformPatterns.td +++ /dev/null @@ -1,34 +0,0 @@ -//===- TestVectorTransformPatterns.td - Test patterns ---*- tablegen ----*-===// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// -// -// This is the pattern definition file for declarative Vector transformations -// tests. -// -//===----------------------------------------------------------------------===// - -#ifndef TEST_VECTOR_TRANSFORMS_PATTERNS -#define TEST_VECTOR_TRANSFORMS_PATTERNS - -include "mlir/Dialect/StandardOps/IR/Ops.td" -include "mlir/Dialect/Vector/VectorOps.td" -include "mlir/Dialect/Vector/VectorTransformPatterns.td" - -def : Pat<(AddFOp:$op_results $a, $b), - (UnrollVectorOp<[2, 2]> $op_results, $a, $b), - [(Constraint> $a)]>; - -def : Pat<(AddFOp:$op_results $a, $b), - (UnrollVectorOp<[2, 2]> $op_results, $a, $b), - [(Constraint> $a)]>; - -// TODO: Add Constraints on lhs/rhs shapes. -def : Pat<(Vector_ContractionOp:$op_results $a, $b, $c, $masks, $attr0, $attr1), - (UnrollVectorOp<[2, 2, 2]> $op_results, $a, $b, $c), - [(Constraint> $c)]>; - -#endif // TEST_VECTOR_TRANSFORMS_PATTERNS diff --git a/mlir/test/lib/DeclarativeTransforms/lit.local.cfg b/mlir/test/lib/DeclarativeTransforms/lit.local.cfg deleted file mode 100644 --- a/mlir/test/lib/DeclarativeTransforms/lit.local.cfg +++ /dev/null @@ -1 +0,0 @@ -config.suffixes.remove('.td') \ No newline at end of file diff --git a/mlir/test/lib/Transforms/CMakeLists.txt b/mlir/test/lib/Transforms/CMakeLists.txt --- a/mlir/test/lib/Transforms/CMakeLists.txt +++ b/mlir/test/lib/Transforms/CMakeLists.txt @@ -32,7 +32,6 @@ DEPENDS MLIRStandardOpsIncGen - MLIRTestVectorTransformPatternsIncGen LINK_LIBS PUBLIC MLIRAffineOps @@ -59,5 +58,3 @@ include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../Dialect/Test) include_directories(${CMAKE_CURRENT_BINARY_DIR}/../Dialect/Test) -include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../DeclarativeTransforms) -include_directories(${CMAKE_CURRENT_BINARY_DIR}/../DeclarativeTransforms) diff --git a/mlir/test/lib/Transforms/TestVectorTransforms.cpp b/mlir/test/lib/Transforms/TestVectorTransforms.cpp --- a/mlir/test/lib/Transforms/TestVectorTransforms.cpp +++ b/mlir/test/lib/Transforms/TestVectorTransforms.cpp @@ -18,16 +18,16 @@ using namespace mlir::vector; namespace { -#include "TestVectorTransformPatterns.h.inc" - struct TestVectorToVectorConversion : public PassWrapper { void runOnFunction() override { OwningRewritePatternList patterns; - auto *context = &getContext(); - populateWithGenerated(context, &patterns); - populateVectorToVectorCanonicalizationPatterns(patterns, context); - populateVectorToVectorTransformationPatterns(patterns, context); + auto *ctx = &getContext(); + patterns.insert>(ArrayRef{2, 2}, ctx); + patterns.insert>( + ArrayRef{2, 2, 2}, ctx); + populateVectorToVectorCanonicalizationPatterns(patterns, ctx); + populateVectorToVectorTransformationPatterns(patterns, ctx); applyPatternsAndFoldGreedily(getFunction(), patterns); } };