diff --git a/mlir/include/mlir/Dialect/Linalg/EDSC/FoldedIntrinsics.h b/mlir/include/mlir/Dialect/Linalg/EDSC/FoldedIntrinsics.h --- a/mlir/include/mlir/Dialect/Linalg/EDSC/FoldedIntrinsics.h +++ b/mlir/include/mlir/Dialect/Linalg/EDSC/FoldedIntrinsics.h @@ -22,9 +22,9 @@ // Builder-based template FoldedValueBuilder(OperationFolder *folder, Args... args) { - value = folder ? folder->create(ScopedContext::getBuilder(), + value = folder ? folder->create(ScopedContext::getBuilderRef(), ScopedContext::getLocation(), args...) - : ScopedContext::getBuilder().create( + : ScopedContext::getBuilderRef().create( ScopedContext::getLocation(), args...); } diff --git a/mlir/include/mlir/Dialect/Linalg/Transforms/CMakeLists.txt b/mlir/include/mlir/Dialect/Linalg/Transforms/CMakeLists.txt --- a/mlir/include/mlir/Dialect/Linalg/Transforms/CMakeLists.txt +++ b/mlir/include/mlir/Dialect/Linalg/Transforms/CMakeLists.txt @@ -1,5 +1,4 @@ set(LLVM_TARGET_DEFINITIONS LinalgTransformPatterns.td) -mlir_tablegen(TestLinalgMatmulToVectorPatterns.h.inc -gen-rewriters) mlir_tablegen(LinalgTransformPatterns.h.inc -gen-rewriters) add_public_tablegen_target(MLIRLinalgTransformPatternsIncGen) diff --git a/mlir/include/mlir/EDSC/Builders.h b/mlir/include/mlir/EDSC/Builders.h --- a/mlir/include/mlir/EDSC/Builders.h +++ b/mlir/include/mlir/EDSC/Builders.h @@ -33,17 +33,17 @@ /// setting and restoring of insertion points. class ScopedContext { public: - ScopedContext(OpBuilder &builder, Location location); + ScopedContext(OpBuilder &b, Location location); /// Sets the insertion point of the builder to 'newInsertPt' for the duration /// of the scope. The existing insertion point of the builder is restored on /// destruction. - ScopedContext(OpBuilder &builder, OpBuilder::InsertPoint newInsertPt, + ScopedContext(OpBuilder &b, OpBuilder::InsertPoint newInsertPt, Location location); ~ScopedContext(); static MLIRContext *getContext(); - static OpBuilder &getBuilder(); + static OpBuilder &getBuilderRef(); static Location getLocation(); private: @@ -59,22 +59,19 @@ /// Top level OpBuilder. OpBuilder &builder; - /// The previous insertion point of the builder. - Optional prevBuilderInsertPoint; + /// Guard to the previous insertion point. + OpBuilder::InsertionGuard guard; /// Current location. Location location; /// Parent context we return into. ScopedContext *enclosingScopedContext; - /// Defensively keeps track of the current NestedBuilder to ensure proper - /// scoping usage. - NestedBuilder *nestedBuilder; }; template struct ValueBuilder { template ValueBuilder(Args... args) { - value = ScopedContext::getBuilder() + value = ScopedContext::getBuilderRef() .create(ScopedContext::getLocation(), args...) .getResult(); } @@ -86,8 +83,8 @@ struct OperationBuilder { template OperationBuilder(Args... args) { - op = ScopedContext::getBuilder().create(ScopedContext::getLocation(), - args...); + op = ScopedContext::getBuilderRef().create(ScopedContext::getLocation(), + args...); } operator Op() { return op; } operator Operation *() { return op.getOperation(); } @@ -122,22 +119,19 @@ /// let the escape. void enter(mlir::Block *block) { bodyScope = new ScopedContext( - ScopedContext::getBuilder(), + ScopedContext::getBuilderRef(), OpBuilder::InsertPoint(block, std::prev(block->end())), ScopedContext::getLocation()); if (!block->empty()) { auto &termOp = block->back(); if (termOp.isKnownTerminator()) - ScopedContext::getBuilder().setInsertionPoint(&termOp); + ScopedContext::getBuilderRef().setInsertionPoint(&termOp); } - bodyScope->nestedBuilder = this; } /// Exit the current mlir::Block by explicitly deleting the dynamically /// allocated OpBuilder and ScopedContext. void exit() { - // Reclaim now to exit the scope. - bodyScope->nestedBuilder = nullptr; delete bodyScope; bodyScope = nullptr; } diff --git a/mlir/lib/Conversion/LinalgToLLVM/LinalgToLLVM.cpp b/mlir/lib/Conversion/LinalgToLLVM/LinalgToLLVM.cpp --- a/mlir/lib/Conversion/LinalgToLLVM/LinalgToLLVM.cpp +++ b/mlir/lib/Conversion/LinalgToLLVM/LinalgToLLVM.cpp @@ -118,7 +118,7 @@ operator Value() { return d; } private: - OpBuilder &rewriter() { return ScopedContext::getBuilder(); } + OpBuilder &rewriter() { return ScopedContext::getBuilderRef(); } Location loc() { return ScopedContext::getLocation(); } MemRefDescriptor d; diff --git a/mlir/lib/Conversion/VectorToLoops/ConvertVectorToLoops.cpp b/mlir/lib/Conversion/VectorToLoops/ConvertVectorToLoops.cpp --- a/mlir/lib/Conversion/VectorToLoops/ConvertVectorToLoops.cpp +++ b/mlir/lib/Conversion/VectorToLoops/ConvertVectorToLoops.cpp @@ -168,7 +168,7 @@ inBounds = inBounds && inBounds2; } - auto ifOp = ScopedContext::getBuilder().create( + auto ifOp = ScopedContext::getBuilderRef().create( ScopedContext::getLocation(), TypeRange{}, inBounds, /*withElseRegion=*/std::is_same()); BlockBuilder(&ifOp.thenRegion().front(), diff --git a/mlir/lib/Dialect/Affine/EDSC/Builders.cpp b/mlir/lib/Dialect/Affine/EDSC/Builders.cpp --- a/mlir/lib/Dialect/Affine/EDSC/Builders.cpp +++ b/mlir/lib/Dialect/Affine/EDSC/Builders.cpp @@ -28,7 +28,7 @@ auto ubConst = dyn_cast(ubDef); if (!lbConst || !ubConst) return Optional(); - return ScopedContext::getBuilder() + return ScopedContext::getBuilderRef() .create(ScopedContext::getLocation(), lbConst.getValue(), ubConst.getValue(), step) .getInductionVar(); @@ -38,16 +38,19 @@ ArrayRef ubs, int64_t step) { mlir::edsc::LoopBuilder result; - if (auto staticForIv = emitStaticFor(lbs, ubs, step)) { + if (auto staticForIv = emitStaticFor(lbs, ubs, step)) *iv = staticForIv.getValue(); - } else { - auto b = ScopedContext::getBuilder(); - *iv = - Value(b.create(ScopedContext::getLocation(), lbs, - b.getMultiDimIdentityMap(lbs.size()), ubs, - b.getMultiDimIdentityMap(ubs.size()), step) - .getInductionVar()); - } + else + *iv = ScopedContext::getBuilderRef() + .create( + ScopedContext::getLocation(), lbs, + ScopedContext::getBuilderRef().getMultiDimIdentityMap( + lbs.size()), + ubs, + ScopedContext::getBuilderRef().getMultiDimIdentityMap( + ubs.size()), + step) + .getInductionVar(); auto *body = getForInductionVarOwner(*iv).getBody(); result.enter(body); @@ -122,7 +125,7 @@ // TODO: createOrFold when available. Operation *op = - makeComposedAffineApply(ScopedContext::getBuilder(), + makeComposedAffineApply(ScopedContext::getBuilderRef(), ScopedContext::getLocation(), map, operands) .getOperation(); assert(op->getNumResults() == 1 && "Expected single result AffineApply"); @@ -218,7 +221,7 @@ assert((lhsType.isa() || lhsType.isSignlessInteger()) && "only integer comparisons are supported"); - return ScopedContext::getBuilder().create( + return ScopedContext::getBuilderRef().create( ScopedContext::getLocation(), predicate, lhs, rhs); } @@ -231,7 +234,7 @@ assert(lhsType == rhsType && "cannot mix types in operators"); assert(lhsType.isa() && "only float comparisons are supported"); - return ScopedContext::getBuilder().create( + return ScopedContext::getBuilderRef().create( ScopedContext::getLocation(), predicate, lhs, rhs); } diff --git a/mlir/lib/Dialect/Linalg/EDSC/Builders.cpp b/mlir/lib/Dialect/Linalg/EDSC/Builders.cpp --- a/mlir/lib/Dialect/Linalg/EDSC/Builders.cpp +++ b/mlir/lib/Dialect/Linalg/EDSC/Builders.cpp @@ -128,7 +128,7 @@ assert(!(outputs[i].getType().isa() && outputs[i + 1].getType().isa()) && "output tensors must be passed after output buffers"); - auto &builder = edsc::ScopedContext::getBuilder(); + auto &builder = edsc::ScopedContext::getBuilderRef(); auto *ctx = builder.getContext(); unsigned nInputs = inputs.size(); unsigned nOutputs = outputs.size(); @@ -157,7 +157,7 @@ llvm::to_vector<8>(llvm::map_range(iteratorTypes, toString)); // clang-format off auto *op = - edsc::ScopedContext::getBuilder() + edsc::ScopedContext::getBuilderRef() .create( edsc::ScopedContext::getLocation(), types, diff --git a/mlir/lib/Dialect/Linalg/Transforms/LinalgToLoops.cpp b/mlir/lib/Dialect/Linalg/Transforms/LinalgToLoops.cpp --- a/mlir/lib/Dialect/Linalg/Transforms/LinalgToLoops.cpp +++ b/mlir/lib/Dialect/Linalg/Transforms/LinalgToLoops.cpp @@ -52,7 +52,7 @@ static SmallVector permuteIvs(ArrayRef ivs, Optional permutation) { - return permutation ? applyMapToValues(ScopedContext::getBuilder(), + return permutation ? applyMapToValues(ScopedContext::getBuilderRef(), ScopedContext::getLocation(), permutation.getValue(), ivs) : SmallVector(ivs.begin(), ivs.end()); @@ -82,7 +82,7 @@ static void inlineRegionAndEmitStore(OpType op, ArrayRef indexedValues, ArrayRef> indexing, ArrayRef outputBuffers) { - auto &b = ScopedContext::getBuilder(); + auto &b = ScopedContext::getBuilderRef(); auto &block = op.region().front(); BlockAndValueMapping map; map.map(block.getArguments(), indexedValues); @@ -110,7 +110,7 @@ template static InputAndOutputIndices getInputAndOutputIndices(ArrayRef allIvs, SingleInputPoolingOp op) { - auto &b = ScopedContext::getBuilder(); + auto &b = ScopedContext::getBuilderRef(); auto loc = ScopedContext::getLocation(); auto mapsRange = op.indexing_maps().template getAsRange(); auto maps = llvm::to_vector<8>( @@ -159,7 +159,7 @@ LinalgOpType linalgOp) { assert(linalgOp.hasBufferSemantics() && "expected linalg op with buffer semantics"); - auto b = ScopedContext::getBuilder(); + auto &b = ScopedContext::getBuilderRef(); auto loc = ScopedContext::getLocation(); unsigned nInputs = linalgOp.getNumInputs(); unsigned nOutputs = linalgOp.getNumOutputs(); @@ -331,7 +331,7 @@ affine_max(dim.getType(), maxMap, ValueRange{dim})); } - auto b = ScopedContext::getBuilder(); + auto &b = ScopedContext::getBuilderRef(); Type type = convOp.input().getType().cast().getElementType(); Value zero = std_constant(type, b.getZeroAttr(type)); Value readInput = im(clampedImIdx); @@ -342,7 +342,7 @@ static void emitScalarImplementation(ArrayRef allIvs, ConvOp convOp) { assert(convOp.hasBufferSemantics() && "expected linalg op with buffer semantics"); - auto b = ScopedContext::getBuilder(); + auto &b = ScopedContext::getBuilderRef(); auto loc = ScopedContext::getLocation(); auto mapsRange = convOp.indexing_maps().getAsRange(); auto maps = llvm::to_vector<8>(llvm::map_range( @@ -445,7 +445,7 @@ IndexedGenericOp indexedGenericOp) { assert(indexedGenericOp.hasBufferSemantics() && "expected linalg op with buffer semantics"); - auto b = ScopedContext::getBuilder(); + auto &b = ScopedContext::getBuilderRef(); auto loc = ScopedContext::getLocation(); unsigned nInputs = indexedGenericOp.getNumInputs(); unsigned nOutputs = indexedGenericOp.getNumOutputs(); @@ -606,7 +606,7 @@ SmallVector allIvs(nLoops); auto loopRanges = - emitLoopRanges(scope.getBuilder(), scope.getLocation(), invertedMap, + emitLoopRanges(scope.getBuilderRef(), scope.getLocation(), invertedMap, getViewSizes(rewriter, linalgOp)); assert(loopRanges.size() == allIvs.size()); Impl::doit(linalgOp, loopRanges, allIvs); diff --git a/mlir/lib/Dialect/Linalg/Transforms/Tiling.cpp b/mlir/lib/Dialect/Linalg/Transforms/Tiling.cpp --- a/mlir/lib/Dialect/Linalg/Transforms/Tiling.cpp +++ b/mlir/lib/Dialect/Linalg/Transforms/Tiling.cpp @@ -384,7 +384,7 @@ linalg_range(range.offset, range.size, range.stride)); } GenericLoopNestRangeBuilder(ivs, linalgRanges)([&] { - auto b = ScopedContext::getBuilder(); + auto &b = ScopedContext::getBuilderRef(); auto loc = ScopedContext::getLocation(); SmallVector ivValues(ivs.begin(), ivs.end()); diff --git a/mlir/lib/EDSC/Builders.cpp b/mlir/lib/EDSC/Builders.cpp --- a/mlir/lib/EDSC/Builders.cpp +++ b/mlir/lib/EDSC/Builders.cpp @@ -15,32 +15,25 @@ using namespace mlir; using namespace mlir::edsc; -mlir::edsc::ScopedContext::ScopedContext(OpBuilder &builder, Location location) - : builder(builder), location(location), - enclosingScopedContext(ScopedContext::getCurrentScopedContext()), - nestedBuilder(nullptr) { +mlir::edsc::ScopedContext::ScopedContext(OpBuilder &b, Location location) + : builder(b), guard(builder), location(location), + enclosingScopedContext(ScopedContext::getCurrentScopedContext()) { getCurrentScopedContext() = this; } /// Sets the insertion point of the builder to 'newInsertPt' for the duration /// of the scope. The existing insertion point of the builder is restored on /// destruction. -mlir::edsc::ScopedContext::ScopedContext(OpBuilder &builder, +mlir::edsc::ScopedContext::ScopedContext(OpBuilder &b, OpBuilder::InsertPoint newInsertPt, Location location) - : builder(builder), prevBuilderInsertPoint(builder.saveInsertionPoint()), - location(location), - enclosingScopedContext(ScopedContext::getCurrentScopedContext()), - nestedBuilder(nullptr) { + : builder(b), guard(builder), location(location), + enclosingScopedContext(ScopedContext::getCurrentScopedContext()) { getCurrentScopedContext() = this; builder.restoreInsertionPoint(newInsertPt); } mlir::edsc::ScopedContext::~ScopedContext() { - assert(!nestedBuilder && - "Active NestedBuilder must have been exited at this point!"); - if (prevBuilderInsertPoint) - builder.restoreInsertionPoint(*prevBuilderInsertPoint); getCurrentScopedContext() = enclosingScopedContext; } @@ -49,7 +42,7 @@ return context; } -OpBuilder &mlir::edsc::ScopedContext::getBuilder() { +OpBuilder &mlir::edsc::ScopedContext::getBuilderRef() { assert(ScopedContext::getCurrentScopedContext() && "Unexpected Null ScopedContext"); return ScopedContext::getCurrentScopedContext()->builder; @@ -62,15 +55,15 @@ } MLIRContext *mlir::edsc::ScopedContext::getContext() { - return getBuilder().getContext(); + return getBuilderRef().getContext(); } BlockHandle mlir::edsc::BlockHandle::create(ArrayRef argTypes) { - auto ¤tB = ScopedContext::getBuilder(); + auto ¤tB = ScopedContext::getBuilderRef(); auto *ib = currentB.getInsertionBlock(); auto ip = currentB.getInsertionPoint(); BlockHandle res; - res.block = ScopedContext::getBuilder().createBlock(ib->getParent()); + res.block = ScopedContext::getBuilderRef().createBlock(ib->getParent()); // createBlock sets the insertion point inside the block. // We do not want this behavior when using declarative builders with nesting. currentB.setInsertionPoint(ib, ip); @@ -82,17 +75,15 @@ BlockHandle mlir::edsc::BlockHandle::createInRegion(Region ®ion, ArrayRef argTypes) { - auto ¤tB = ScopedContext::getBuilder(); BlockHandle res; region.push_back(new Block); res.block = ®ion.back(); // createBlock sets the insertion point inside the block. // We do not want this behavior when using declarative builders with nesting. - OpBuilder::InsertionGuard g(currentB); - currentB.setInsertionPoint(res.block, res.block->begin()); - for (auto t : argTypes) { - res.block->addArgument(t); - } + OpBuilder::InsertionGuard g(ScopedContext::getBuilderRef()); + ScopedContext::getBuilderRef().setInsertionPoint(res.block, + res.block->begin()); + res.block->addArguments(argTypes); return res; } diff --git a/mlir/test/Dialect/Linalg/matmul-to-vector.mlir b/mlir/test/Dialect/Linalg/matmul-to-vector.mlir deleted file mode 100644 --- a/mlir/test/Dialect/Linalg/matmul-to-vector.mlir +++ /dev/null @@ -1,16 +0,0 @@ -// RUN: mlir-opt %s -linalg-matmul-to-vector | FileCheck %s - -func @matmul_perm(%A: memref<1584x1584xf32, offset: 0, strides: [1584, 1]>, - %B: memref<1584x1584xf32, offset: 0, strides: [1584, 1]>, - %C: memref<1584x1584xf32, offset: 0, strides: [1584, 1]>) { - linalg.matmul(%A, %B, %C) {__internal_linalg_transform__ = "__with_perm__"} : - memref<1584x1584xf32, offset: 0, strides: [1584, 1]>, - memref<1584x1584xf32, offset: 0, strides: [1584, 1]>, - memref<1584x1584xf32, offset: 0, strides: [1584, 1]> - return -} - -// CHECK-LABEL:func @matmul_perm -// CHECK: vector.contract -// CHECK-SAME: iterator_types = ["parallel", "parallel", "reduction"] -// CHECK-SAME: : vector<8x16xf32>, vector<16x12xf32> into vector<8x12xf32> diff --git a/mlir/test/lib/DeclarativeTransforms/CMakeLists.txt b/mlir/test/lib/DeclarativeTransforms/CMakeLists.txt --- a/mlir/test/lib/DeclarativeTransforms/CMakeLists.txt +++ b/mlir/test/lib/DeclarativeTransforms/CMakeLists.txt @@ -7,9 +7,3 @@ set(LLVM_TARGET_DEFINITIONS TestVectorTransformPatterns.td) mlir_tablegen(TestVectorTransformPatterns.h.inc -gen-rewriters) add_public_tablegen_target(MLIRTestVectorTransformPatternsIncGen) - -set(LLVM_TARGET_DEFINITIONS TestLinalgMatmulToVectorPatterns.td) -mlir_tablegen(TestLinalgMatmulToVectorPatterns.h.inc -gen-rewriters) -add_public_tablegen_target(MLIRTestLinalgMatmulToVectorPatternsIncGen) -# Including Linalg in TableGen requires to depends on generated files -add_dependencies(MLIRTestLinalgTransformPatternsIncGen LinalgOdsGen) diff --git a/mlir/test/lib/DeclarativeTransforms/TestLinalgMatmulToVectorPatterns.td b/mlir/test/lib/DeclarativeTransforms/TestLinalgMatmulToVectorPatterns.td deleted file mode 100644 --- a/mlir/test/lib/DeclarativeTransforms/TestLinalgMatmulToVectorPatterns.td +++ /dev/null @@ -1,43 +0,0 @@ -//===- TestLinalgMatmulToVectorPatterns.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 Linalg transformations -// tests. -// -//===----------------------------------------------------------------------===// - -#ifndef TEST_LINALG_MATMUL_TO_VECTOR_PATTERNS -#define TEST_LINALG_MATMUL_TO_VECTOR_PATTERNS - -include "mlir/Dialect/Linalg/Transforms/LinalgTransformPatterns.td" -include "mlir/Dialect/Vector/VectorTransformPatterns.td" - -//===----------------------------------------------------------------------===// -// Linalg tiling and permutation patterns. -//===----------------------------------------------------------------------===// -def : Pat<(MatmulOp:$op $_, $_, $_), - (TileLinalgOp<[768, 264, 768], "L2__with_perm__", [1, 2, 0]>), - [(Constraint>)]>; -def : Pat<(MatmulOp:$op $_, $_, $_), - (TileLinalgOp<[8, 12, 16], "L1__with_perm__", [1, 0, 2]>), - [(Constraint>)]>; -def : Pat<(MatmulOp:$op $_, $_, $_), - (PromoteSubviewsLinalgOp), - [(Constraint>), - (Constraint>)]>; - -//===----------------------------------------------------------------------===// -// Linalg to vector contraction patterns. -//===----------------------------------------------------------------------===// -def : Pattern<(MatmulOp:$op $_, $_, $_), - [(VectorizeLinalgOp)], - [(Constraint, - PreconditionVectorizeLinalgOp]>>)]>; - -#endif // TEST_LINALG_MATMUL_TO_VECTOR_PATTERNS 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 @@ -9,7 +9,6 @@ TestGpuMemoryPromotion.cpp TestGpuParallelLoopMapping.cpp TestInlining.cpp - TestLinalgMatmulToVector.cpp TestLinalgTransforms.cpp TestLiveness.cpp TestLoopMapping.cpp @@ -26,7 +25,6 @@ DEPENDS MLIRStandardOpsIncGen - MLIRTestLinalgMatmulToVectorPatternsIncGen MLIRTestLinalgTransformPatternsIncGen MLIRTestVectorTransformPatternsIncGen ) diff --git a/mlir/test/lib/Transforms/TestLinalgMatmulToVector.cpp b/mlir/test/lib/Transforms/TestLinalgMatmulToVector.cpp deleted file mode 100644 --- a/mlir/test/lib/Transforms/TestLinalgMatmulToVector.cpp +++ /dev/null @@ -1,51 +0,0 @@ -//===- TestLinalgMatmulToVector.cpp - Test VectorTransfers lowering -------===// -// -// 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 -// -//===----------------------------------------------------------------------===// - -#include - -#include "mlir/Dialect/Affine/IR/AffineOps.h" -#include "mlir/Dialect/Linalg/IR/LinalgOps.h" -#include "mlir/Dialect/Linalg/Transforms/LinalgTransforms.h" -#include "mlir/Dialect/Vector/VectorOps.h" -#include "mlir/Dialect/Vector/VectorTransforms.h" -#include "mlir/IR/PatternMatch.h" -#include "mlir/IR/StandardTypes.h" -#include "mlir/Pass/Pass.h" - -using namespace mlir; -using namespace mlir::linalg; -using namespace mlir::vector; - -namespace { -#include "TestLinalgMatmulToVectorPatterns.h.inc" - -struct DeclarativeTransforms - : public PassWrapper { - void runOnFunction() override { - OwningRewritePatternList patterns; - auto *context = &getContext(); - AffineApplyOp::getCanonicalizationPatterns(patterns, context); - AffineMinOp::getCanonicalizationPatterns(patterns, context); - AffineMaxOp::getCanonicalizationPatterns(patterns, context); - AllocOp::getCanonicalizationPatterns(patterns, context); - SubViewOp::getCanonicalizationPatterns(patterns, context); - ViewOp::getCanonicalizationPatterns(patterns, context); - populateWithGenerated(context, &patterns); - applyPatternsAndFoldGreedily(getFunction(), patterns); - } -}; -} // end anonymous namespace - -namespace mlir { -void registerTestLinalgMatmulToVectorPass() { - PassRegistration pass( - "linalg-matmul-to-vector", - "Test declarative transform patterns for matmul 3-D tiling + promotion" - " + vectorization"); -} -} // namespace mlir diff --git a/mlir/tools/mlir-opt/mlir-opt.cpp b/mlir/tools/mlir-opt/mlir-opt.cpp --- a/mlir/tools/mlir-opt/mlir-opt.cpp +++ b/mlir/tools/mlir-opt/mlir-opt.cpp @@ -42,7 +42,6 @@ void registerTestAllReduceLoweringPass(); void registerTestAffineLoopUnswitchingPass(); void registerTestBufferPlacementPreparationPass(); -void registerTestLinalgMatmulToVectorPass(); void registerTestLoopPermutationPass(); void registerTestCallGraphPass(); void registerTestConstantFold(); @@ -106,7 +105,6 @@ registerTestAffineDataCopyPass(); registerTestAllReduceLoweringPass(); registerTestAffineLoopUnswitchingPass(); - registerTestLinalgMatmulToVectorPass(); registerTestLoopPermutationPass(); registerTestCallGraphPass(); registerTestConstantFold();