diff --git a/mlir/include/mlir/IR/PatternMatch.h b/mlir/include/mlir/IR/PatternMatch.h --- a/mlir/include/mlir/IR/PatternMatch.h +++ b/mlir/include/mlir/IR/PatternMatch.h @@ -1061,7 +1061,7 @@ private: LogicalResult (*implFn)(OpType, PatternRewriter &rewriter); }; - insert(std::make_unique(std::move(implFn), getContext())); + add(std::make_unique(std::move(implFn), getContext())); return *this; } diff --git a/mlir/lib/Conversion/GPUToNVVM/WmmaOpsToNvvm.cpp b/mlir/lib/Conversion/GPUToNVVM/WmmaOpsToNvvm.cpp --- a/mlir/lib/Conversion/GPUToNVVM/WmmaOpsToNvvm.cpp +++ b/mlir/lib/Conversion/GPUToNVVM/WmmaOpsToNvvm.cpp @@ -370,7 +370,7 @@ void mlir::populateGpuWMMAToNVVMConversionPatterns( LLVMTypeConverter &converter, RewritePatternSet &patterns) { - patterns.insert(converter); + patterns.add(converter); } diff --git a/mlir/lib/Dialect/Arithmetic/IR/ArithmeticOps.cpp b/mlir/lib/Dialect/Arithmetic/IR/ArithmeticOps.cpp --- a/mlir/lib/Dialect/Arithmetic/IR/ArithmeticOps.cpp +++ b/mlir/lib/Dialect/Arithmetic/IR/ArithmeticOps.cpp @@ -210,7 +210,7 @@ void arith::AddIOp::getCanonicalizationPatterns( RewritePatternSet &patterns, MLIRContext *context) { - patterns.insert( + patterns.add( context); } @@ -232,9 +232,10 @@ void arith::SubIOp::getCanonicalizationPatterns( RewritePatternSet &patterns, MLIRContext *context) { - patterns.insert(context); + patterns + .add( + context); } //===----------------------------------------------------------------------===// @@ -568,7 +569,7 @@ void arith::XOrIOp::getCanonicalizationPatterns( RewritePatternSet &patterns, MLIRContext *context) { - patterns.insert(context); + patterns.add(context); } //===----------------------------------------------------------------------===// @@ -913,7 +914,7 @@ void arith::ExtSIOp::getCanonicalizationPatterns( RewritePatternSet &patterns, MLIRContext *context) { - patterns.insert(context); + patterns.add(context); } LogicalResult arith::ExtSIOp::verify() { @@ -1007,7 +1008,7 @@ void arith::AndIOp::getCanonicalizationPatterns( RewritePatternSet &patterns, MLIRContext *context) { - patterns.insert(context); + patterns.add(context); } //===----------------------------------------------------------------------===// @@ -1016,7 +1017,7 @@ void arith::OrIOp::getCanonicalizationPatterns( RewritePatternSet &patterns, MLIRContext *context) { - patterns.insert(context); + patterns.add(context); } //===----------------------------------------------------------------------===// @@ -1155,7 +1156,7 @@ void arith::IndexCastOp::getCanonicalizationPatterns( RewritePatternSet &patterns, MLIRContext *context) { - patterns.insert(context); + patterns.add(context); } //===----------------------------------------------------------------------===// @@ -1204,7 +1205,7 @@ void arith::BitcastOp::getCanonicalizationPatterns( RewritePatternSet &patterns, MLIRContext *context) { - patterns.insert(context); + patterns.add(context); } //===----------------------------------------------------------------------===// @@ -1461,7 +1462,7 @@ void arith::SelectOp::getCanonicalizationPatterns(RewritePatternSet &results, MLIRContext *context) { - results.insert(context); + results.add(context); } OpFoldResult arith::SelectOp::fold(ArrayRef operands) { diff --git a/mlir/lib/Dialect/Bufferization/IR/BufferizationOps.cpp b/mlir/lib/Dialect/Bufferization/IR/BufferizationOps.cpp --- a/mlir/lib/Dialect/Bufferization/IR/BufferizationOps.cpp +++ b/mlir/lib/Dialect/Bufferization/IR/BufferizationOps.cpp @@ -104,7 +104,7 @@ void CloneOp::getCanonicalizationPatterns(RewritePatternSet &results, MLIRContext *context) { - results.insert(context); + results.add(context); } //===----------------------------------------------------------------------===// diff --git a/mlir/lib/Dialect/Linalg/IR/LinalgOps.cpp b/mlir/lib/Dialect/Linalg/IR/LinalgOps.cpp --- a/mlir/lib/Dialect/Linalg/IR/LinalgOps.cpp +++ b/mlir/lib/Dialect/Linalg/IR/LinalgOps.cpp @@ -1692,11 +1692,11 @@ void TiledLoopOp::getCanonicalizationPatterns(RewritePatternSet &results, MLIRContext *context) { - results.insert, - DimOfTiledLoopInsOutsFolder, - DimOfTiledLoopResultFolder, - DimOfTiledLoopResultFolder>(context); + results.add, + DimOfTiledLoopInsOutsFolder, + DimOfTiledLoopResultFolder, + DimOfTiledLoopResultFolder>(context); } LogicalResult TiledLoopOp::fold(ArrayRef, diff --git a/mlir/lib/Dialect/Linalg/Transforms/Detensorize.cpp b/mlir/lib/Dialect/Linalg/Transforms/Detensorize.cpp --- a/mlir/lib/Dialect/Linalg/Transforms/Detensorize.cpp +++ b/mlir/lib/Dialect/Linalg/Transforms/Detensorize.cpp @@ -533,9 +533,9 @@ return false; }); - patterns.insert(typeConverter, context); - patterns.insert(context, typeConverter, - blockArgsToDetensor); + patterns.add(typeConverter, context); + patterns.add(context, typeConverter, + blockArgsToDetensor); // Since non-entry block arguments get detensorized, we also need to // update the control flow inside the function to reflect the correct // types. diff --git a/mlir/lib/Dialect/MemRef/Transforms/ComposeSubView.cpp b/mlir/lib/Dialect/MemRef/Transforms/ComposeSubView.cpp --- a/mlir/lib/Dialect/MemRef/Transforms/ComposeSubView.cpp +++ b/mlir/lib/Dialect/MemRef/Transforms/ComposeSubView.cpp @@ -129,5 +129,5 @@ void mlir::memref::populateComposeSubViewPatterns( RewritePatternSet &patterns, MLIRContext *context) { - patterns.insert(context); + patterns.add(context); } diff --git a/mlir/lib/Dialect/SCF/SCF.cpp b/mlir/lib/Dialect/SCF/SCF.cpp --- a/mlir/lib/Dialect/SCF/SCF.cpp +++ b/mlir/lib/Dialect/SCF/SCF.cpp @@ -2844,9 +2844,9 @@ void WhileOp::getCanonicalizationPatterns(RewritePatternSet &results, MLIRContext *context) { - results.insert(context); + results.add(context); } //===----------------------------------------------------------------------===// diff --git a/mlir/lib/Dialect/SCF/Transforms/LoopCanonicalization.cpp b/mlir/lib/Dialect/SCF/Transforms/LoopCanonicalization.cpp --- a/mlir/lib/Dialect/SCF/Transforms/LoopCanonicalization.cpp +++ b/mlir/lib/Dialect/SCF/Transforms/LoopCanonicalization.cpp @@ -196,12 +196,11 @@ RewritePatternSet &patterns) { MLIRContext *ctx = patterns.getContext(); patterns - .insert, - AffineOpSCFCanonicalizationPattern, - DimOfIterArgFolder, - DimOfIterArgFolder, - DimOfLoopResultFolder, - DimOfLoopResultFolder>(ctx); + .add, + AffineOpSCFCanonicalizationPattern, + DimOfIterArgFolder, DimOfIterArgFolder, + DimOfLoopResultFolder, + DimOfLoopResultFolder>(ctx); } std::unique_ptr mlir::createSCFForLoopCanonicalizationPass() { diff --git a/mlir/lib/Dialect/StandardOps/Transforms/FuncConversions.cpp b/mlir/lib/Dialect/StandardOps/Transforms/FuncConversions.cpp --- a/mlir/lib/Dialect/StandardOps/Transforms/FuncConversions.cpp +++ b/mlir/lib/Dialect/StandardOps/Transforms/FuncConversions.cpp @@ -110,7 +110,7 @@ void mlir::populateBranchOpInterfaceTypeConversionPattern( RewritePatternSet &patterns, TypeConverter &typeConverter, function_ref shouldConvertBranchOperand) { - patterns.insert( + patterns.add( typeConverter, patterns.getContext(), shouldConvertBranchOperand); } diff --git a/mlir/lib/Dialect/Tosa/IR/TosaOps.cpp b/mlir/lib/Dialect/Tosa/IR/TosaOps.cpp --- a/mlir/lib/Dialect/Tosa/IR/TosaOps.cpp +++ b/mlir/lib/Dialect/Tosa/IR/TosaOps.cpp @@ -130,7 +130,7 @@ void ConcatOp::getCanonicalizationPatterns(RewritePatternSet &results, MLIRContext *context) { - results.insert(context); + results.add(context); } struct ReshapeReshapeOptimization : public OpRewritePattern { @@ -188,8 +188,8 @@ void ReshapeOp::getCanonicalizationPatterns(RewritePatternSet &results, MLIRContext *context) { - results.insert(context); - results.insert(context); + results.add(context); + results.add(context); } struct ConstantTransposeOptimization @@ -285,8 +285,8 @@ void TransposeOp::getCanonicalizationPatterns(RewritePatternSet &results, MLIRContext *context) { - results.insert(context); - results.insert(context); + results.add(context); + results.add(context); } struct AddZeroOptimization : public OpRewritePattern { @@ -323,7 +323,7 @@ void AddOp::getCanonicalizationPatterns(RewritePatternSet &results, MLIRContext *context) { - results.insert(context); + results.add(context); } struct MulOneOptimization : public OpRewritePattern { @@ -372,7 +372,7 @@ void MulOp::getCanonicalizationPatterns(RewritePatternSet &results, MLIRContext *context) { - results.insert(context); + results.add(context); } struct MaterializePadValue : public OpRewritePattern { @@ -419,7 +419,7 @@ void PadOp::getCanonicalizationPatterns(RewritePatternSet &results, MLIRContext *context) { - results.insert(context); + results.add(context); } struct MaxPool2dIsNoOp : public OpRewritePattern { @@ -454,7 +454,7 @@ void MaxPool2dOp::getCanonicalizationPatterns(RewritePatternSet &results, MLIRContext *context) { - results.insert(context); + results.add(context); } struct ClampIsNoOp : public OpRewritePattern { @@ -556,8 +556,8 @@ void ClampOp::getCanonicalizationPatterns(RewritePatternSet &results, MLIRContext *context) { - results.insert(context); - results.insert(context); + results.add(context); + results.add(context); } //===----------------------------------------------------------------------===// diff --git a/mlir/lib/Dialect/Tosa/Transforms/TosaDecomposeConv2D.cpp b/mlir/lib/Dialect/Tosa/Transforms/TosaDecomposeConv2D.cpp --- a/mlir/lib/Dialect/Tosa/Transforms/TosaDecomposeConv2D.cpp +++ b/mlir/lib/Dialect/Tosa/Transforms/TosaDecomposeConv2D.cpp @@ -111,5 +111,5 @@ void mlir::tosa::populateTosaDecomposeConv2D(MLIRContext *ctx, RewritePatternSet &patterns) { - patterns.insert(ctx); + patterns.add(ctx); } diff --git a/mlir/lib/Dialect/Tosa/Transforms/TosaDecomposeDepthwise.cpp b/mlir/lib/Dialect/Tosa/Transforms/TosaDecomposeDepthwise.cpp --- a/mlir/lib/Dialect/Tosa/Transforms/TosaDecomposeDepthwise.cpp +++ b/mlir/lib/Dialect/Tosa/Transforms/TosaDecomposeDepthwise.cpp @@ -117,5 +117,5 @@ void mlir::tosa::populateTosaDecomposeDepthwise(MLIRContext *ctx, RewritePatternSet &patterns) { - patterns.insert(ctx); + patterns.add(ctx); } diff --git a/mlir/lib/Dialect/Tosa/Transforms/TosaDecomposeTransposeConv.cpp b/mlir/lib/Dialect/Tosa/Transforms/TosaDecomposeTransposeConv.cpp --- a/mlir/lib/Dialect/Tosa/Transforms/TosaDecomposeTransposeConv.cpp +++ b/mlir/lib/Dialect/Tosa/Transforms/TosaDecomposeTransposeConv.cpp @@ -375,6 +375,6 @@ void mlir::tosa::populateTosaDecomposeTransposeConv( MLIRContext *ctx, RewritePatternSet &patterns) { - patterns.insert(ctx); - patterns.insert(ctx); + patterns.add(ctx); + patterns.add(ctx); } diff --git a/mlir/unittests/Transforms/Canonicalizer.cpp b/mlir/unittests/Transforms/Canonicalizer.cpp --- a/mlir/unittests/Transforms/Canonicalizer.cpp +++ b/mlir/unittests/Transforms/Canonicalizer.cpp @@ -58,7 +58,7 @@ } void getCanonicalizationPatterns(RewritePatternSet &results) const override { - results.insert(results.getContext()); + results.add(results.getContext()); } };