From 9f85c198dbd55fa747de55b746c90acb740bede8 Mon Sep 17 00:00:00 2001 From: River Riddle Date: Wed, 26 Jan 2022 14:42:38 -0800 Subject: [PATCH] [mlir] Finish replacing OwningRewritePatternList with RewritePatternSet OwningRewritePatternList has been deprecated for ~10 months now, we can remove the leftover using directives at this point. Differential Revision: https://reviews.llvm.org/D118287 --- flang/lib/Optimizer/CodeGen/CodeGen.cpp | 2 +- flang/lib/Optimizer/CodeGen/PreCGRewrite.cpp | 2 +- flang/lib/Optimizer/Dialect/FIROps.cpp | 6 +++--- .../lib/Optimizer/Transforms/AbstractResult.cpp | 2 +- .../lib/Optimizer/Transforms/AffineDemotion.cpp | 2 +- .../lib/Optimizer/Transforms/AffinePromotion.cpp | 2 +- .../lib/Optimizer/Transforms/ArrayValueCopy.cpp | 4 ++-- .../Optimizer/Transforms/CharacterConversion.cpp | 2 +- .../Transforms/ExternalNameConversion.cpp | 2 +- .../Optimizer/Transforms/MemoryAllocation.cpp | 2 +- flang/lib/Optimizer/Transforms/RewriteLoop.cpp | 2 +- .../AffineToStandard/AffineToStandard.h | 1 - .../mlir/Conversion/AsyncToLLVM/AsyncToLLVM.h | 1 - .../mlir/Conversion/GPUCommon/GPUCommonPass.h | 3 +-- .../mlir/Conversion/GPUToNVVM/GPUToNVVMPass.h | 1 - .../mlir/Conversion/GPUToROCDL/GPUToROCDLPass.h | 1 - .../Conversion/LinalgToSPIRV/LinalgToSPIRV.h | 1 - .../OpenMPToLLVM/ConvertOpenMPToLLVM.h | 1 - mlir/include/mlir/Conversion/SCFToGPU/SCFToGPU.h | 1 - .../mlir/Conversion/SCFToSPIRV/SCFToSPIRV.h | 1 - .../Conversion/SCFToStandard/SCFToStandard.h | 1 - .../Conversion/ShapeToStandard/ShapeToStandard.h | 1 - .../Conversion/VectorToROCDL/VectorToROCDL.h | 1 - mlir/include/mlir/Dialect/AMX/Transforms.h | 1 - mlir/include/mlir/Dialect/ArmSVE/Transforms.h | 1 - .../mlir/Dialect/Linalg/Transforms/Transforms.h | 4 ++-- .../Dialect/MemRef/Transforms/ComposeSubView.h | 3 +-- mlir/include/mlir/Dialect/SCF/Transforms.h | 1 - .../StandardOps/Transforms/FuncConversions.h | 1 - .../mlir/Dialect/StandardOps/Transforms/Passes.h | 1 - .../mlir/Dialect/Tensor/Transforms/Passes.h | 1 - mlir/include/mlir/Dialect/Vector/VectorOps.h | 1 - .../mlir/Dialect/Vector/VectorTransforms.h | 2 -- mlir/include/mlir/Dialect/X86Vector/Transforms.h | 1 - mlir/include/mlir/IR/OperationSupport.h | 4 +--- .../Conversion/GPUCommon/GPUToLLVMConversion.cpp | 2 +- .../Conversion/OpenACCToLLVM/OpenACCToLLVM.cpp | 2 +- mlir/lib/Dialect/Arithmetic/IR/ArithmeticOps.cpp | 16 ++++++++-------- .../ArmSVE/Transforms/LegalizeForLLVMExport.cpp | 2 +- .../Bufferization/IR/BufferizationOps.cpp | 2 +- .../Bufferization/Transforms/Bufferize.cpp | 2 +- mlir/lib/Dialect/Linalg/IR/LinalgOps.cpp | 2 +- .../Dialect/MemRef/Transforms/ComposeSubView.cpp | 2 +- mlir/lib/Dialect/SCF/SCF.cpp | 2 +- mlir/lib/Dialect/StandardOps/IR/Ops.cpp | 2 +- mlir/lib/Dialect/Tosa/IR/TosaOps.cpp | 16 ++++++++-------- .../Dialect/Linalg/TestLinalgDistribution.cpp | 2 +- .../lib/Dialect/MemRef/TestComposeSubView.cpp | 2 +- 48 files changed, 46 insertions(+), 71 deletions(-) diff --git a/flang/lib/Optimizer/CodeGen/CodeGen.cpp b/flang/lib/Optimizer/CodeGen/CodeGen.cpp index 9072cf447e1d..dc766ab2fde5 100644 --- a/flang/lib/Optimizer/CodeGen/CodeGen.cpp +++ b/flang/lib/Optimizer/CodeGen/CodeGen.cpp @@ -3266,7 +3266,7 @@ public: auto *context = getModule().getContext(); fir::LLVMTypeConverter typeConverter{getModule()}; - mlir::OwningRewritePatternList pattern(context); + mlir::RewritePatternSet pattern(context); pattern.insert< AbsentOpConversion, AddcOpConversion, AddrOfOpConversion, AllocaOpConversion, AllocMemOpConversion, BoxAddrOpConversion, diff --git a/flang/lib/Optimizer/CodeGen/PreCGRewrite.cpp b/flang/lib/Optimizer/CodeGen/PreCGRewrite.cpp index 712b643e1e05..fc0642e698af 100644 --- a/flang/lib/Optimizer/CodeGen/PreCGRewrite.cpp +++ b/flang/lib/Optimizer/CodeGen/PreCGRewrite.cpp @@ -260,7 +260,7 @@ public: return !(embox.getShape() || embox.getType().cast().getEleTy().isa()); }); - mlir::OwningRewritePatternList patterns(&context); + mlir::RewritePatternSet patterns(&context); patterns.insert( &context); if (mlir::failed( diff --git a/flang/lib/Optimizer/Dialect/FIROps.cpp b/flang/lib/Optimizer/Dialect/FIROps.cpp index 36c7c8f57461..8f702b3245f4 100644 --- a/flang/lib/Optimizer/Dialect/FIROps.cpp +++ b/flang/lib/Optimizer/Dialect/FIROps.cpp @@ -784,8 +784,8 @@ static mlir::LogicalResult verify(fir::ConstcOp &op) { // ConvertOp //===----------------------------------------------------------------------===// -void fir::ConvertOp::getCanonicalizationPatterns( - OwningRewritePatternList &results, MLIRContext *context) { +void fir::ConvertOp::getCanonicalizationPatterns(RewritePatternSet &results, + MLIRContext *context) { results.insert( context); @@ -1508,7 +1508,7 @@ struct UndoComplexPattern : public mlir::RewritePattern { }; void fir::InsertValueOp::getCanonicalizationPatterns( - mlir::OwningRewritePatternList &results, mlir::MLIRContext *context) { + mlir::RewritePatternSet &results, mlir::MLIRContext *context) { results.insert, UndoComplexPattern>(context); } diff --git a/flang/lib/Optimizer/Transforms/AbstractResult.cpp b/flang/lib/Optimizer/Transforms/AbstractResult.cpp index 465755c87cca..7a7207c91645 100644 --- a/flang/lib/Optimizer/Transforms/AbstractResult.cpp +++ b/flang/lib/Optimizer/Transforms/AbstractResult.cpp @@ -216,7 +216,7 @@ public: auto *context = &getContext(); auto func = getOperation(); auto loc = func.getLoc(); - mlir::OwningRewritePatternList patterns(context); + mlir::RewritePatternSet patterns(context); mlir::ConversionTarget target = *context; AbstractResultOptions options{passResultAsBox.getValue(), /*newArg=*/{}}; diff --git a/flang/lib/Optimizer/Transforms/AffineDemotion.cpp b/flang/lib/Optimizer/Transforms/AffineDemotion.cpp index 947c89b01588..bdf73c7e39b8 100644 --- a/flang/lib/Optimizer/Transforms/AffineDemotion.cpp +++ b/flang/lib/Optimizer/Transforms/AffineDemotion.cpp @@ -143,7 +143,7 @@ public: LLVM_DEBUG(llvm::dbgs() << "AffineDemotion: running on function:\n"; function.print(llvm::dbgs());); - mlir::OwningRewritePatternList patterns(context); + mlir::RewritePatternSet patterns(context); patterns.insert(context); patterns.insert(context); patterns.insert(context); diff --git a/flang/lib/Optimizer/Transforms/AffinePromotion.cpp b/flang/lib/Optimizer/Transforms/AffinePromotion.cpp index 830ed6bbacb5..3f45aa4f8dc5 100644 --- a/flang/lib/Optimizer/Transforms/AffinePromotion.cpp +++ b/flang/lib/Optimizer/Transforms/AffinePromotion.cpp @@ -587,7 +587,7 @@ public: auto function = getOperation(); markAllAnalysesPreserved(); auto functionAnalysis = AffineFunctionAnalysis(function); - mlir::OwningRewritePatternList patterns(context); + mlir::RewritePatternSet patterns(context); patterns.insert(context, functionAnalysis); patterns.insert(context, functionAnalysis); mlir::ConversionTarget target = *context; diff --git a/flang/lib/Optimizer/Transforms/ArrayValueCopy.cpp b/flang/lib/Optimizer/Transforms/ArrayValueCopy.cpp index 4f9d17526f5c..c2a607a43ae2 100644 --- a/flang/lib/Optimizer/Transforms/ArrayValueCopy.cpp +++ b/flang/lib/Optimizer/Transforms/ArrayValueCopy.cpp @@ -784,7 +784,7 @@ public: // array accesses are rewritten we can go on phase 2. // Phase 2 gets rid of the useless copy-in/copyout operations. The copy-in // /copy-out refers the Fortran copy-in/copy-out semantics on statements. - mlir::OwningRewritePatternList patterns1(context); + mlir::RewritePatternSet patterns1(context); patterns1.insert(context, useMap); patterns1.insert(context, analysis, useMap); patterns1.insert(context, analysis, useMap); @@ -801,7 +801,7 @@ public: signalPassFailure(); } - mlir::OwningRewritePatternList patterns2(context); + mlir::RewritePatternSet patterns2(context); patterns2.insert(context); patterns2.insert(context); target.addIllegalOp(); diff --git a/flang/lib/Optimizer/Transforms/CharacterConversion.cpp b/flang/lib/Optimizer/Transforms/CharacterConversion.cpp index a1701cca10aa..d166d5165dd3 100644 --- a/flang/lib/Optimizer/Transforms/CharacterConversion.cpp +++ b/flang/lib/Optimizer/Transforms/CharacterConversion.cpp @@ -101,7 +101,7 @@ public: if (clOpts.runtimeName.empty()) { auto *context = &getContext(); auto *func = getOperation(); - mlir::OwningRewritePatternList patterns(context); + mlir::RewritePatternSet patterns(context); patterns.insert(context); mlir::ConversionTarget target(*context); target.addLegalDialect(context); diff --git a/flang/lib/Optimizer/Transforms/MemoryAllocation.cpp b/flang/lib/Optimizer/Transforms/MemoryAllocation.cpp index 83c77d689584..faaea1931a9c 100644 --- a/flang/lib/Optimizer/Transforms/MemoryAllocation.cpp +++ b/flang/lib/Optimizer/Transforms/MemoryAllocation.cpp @@ -172,7 +172,7 @@ public: void runOnOperation() override { auto *context = &getContext(); auto func = getOperation(); - mlir::OwningRewritePatternList patterns(context); + mlir::RewritePatternSet patterns(context); mlir::ConversionTarget target(*context); useCommandLineOptions(); diff --git a/flang/lib/Optimizer/Transforms/RewriteLoop.cpp b/flang/lib/Optimizer/Transforms/RewriteLoop.cpp index bd13a1dc98e0..84e377540635 100644 --- a/flang/lib/Optimizer/Transforms/RewriteLoop.cpp +++ b/flang/lib/Optimizer/Transforms/RewriteLoop.cpp @@ -296,7 +296,7 @@ class CfgConversion : public CFGConversionBase { public: void runOnOperation() override { auto *context = &getContext(); - mlir::OwningRewritePatternList patterns(context); + mlir::RewritePatternSet patterns(context); patterns.insert( context, forceLoopToExecuteOnce); mlir::ConversionTarget target(*context); diff --git a/mlir/include/mlir/Conversion/AffineToStandard/AffineToStandard.h b/mlir/include/mlir/Conversion/AffineToStandard/AffineToStandard.h index b8afecdaa93d..bfebeaec54c9 100644 --- a/mlir/include/mlir/Conversion/AffineToStandard/AffineToStandard.h +++ b/mlir/include/mlir/Conversion/AffineToStandard/AffineToStandard.h @@ -25,7 +25,6 @@ class Value; class ValueRange; class RewritePatternSet; -using OwningRewritePatternList = RewritePatternSet; /// Emit code that computes the given affine expression using standard /// arithmetic operations applied to the provided dimension and symbol values. diff --git a/mlir/include/mlir/Conversion/AsyncToLLVM/AsyncToLLVM.h b/mlir/include/mlir/Conversion/AsyncToLLVM/AsyncToLLVM.h index 0878c633ec4f..56db59dedd7a 100644 --- a/mlir/include/mlir/Conversion/AsyncToLLVM/AsyncToLLVM.h +++ b/mlir/include/mlir/Conversion/AsyncToLLVM/AsyncToLLVM.h @@ -20,7 +20,6 @@ class OperationPass; class MLIRContext; class TypeConverter; class RewritePatternSet; -using OwningRewritePatternList = RewritePatternSet; /// Create a pass to convert Async operations to the LLVM dialect. std::unique_ptr> createConvertAsyncToLLVMPass(); diff --git a/mlir/include/mlir/Conversion/GPUCommon/GPUCommonPass.h b/mlir/include/mlir/Conversion/GPUCommon/GPUCommonPass.h index c43eb24973bc..b048a761f1e7 100644 --- a/mlir/include/mlir/Conversion/GPUCommon/GPUCommonPass.h +++ b/mlir/include/mlir/Conversion/GPUCommon/GPUCommonPass.h @@ -26,7 +26,6 @@ struct LogicalResult; class ModuleOp; class Operation; class RewritePatternSet; -using OwningRewritePatternList = RewritePatternSet; template class OperationPass; @@ -56,7 +55,7 @@ std::unique_ptr> createGpuToLLVMConversionPass(); /// Collect a set of patterns to convert from the GPU dialect to LLVM and /// populate converter for gpu types. void populateGpuToLLVMConversionPatterns(LLVMTypeConverter &converter, - OwningRewritePatternList &patterns, + RewritePatternSet &patterns, StringRef gpuBinaryAnnotation = {}); } // namespace mlir diff --git a/mlir/include/mlir/Conversion/GPUToNVVM/GPUToNVVMPass.h b/mlir/include/mlir/Conversion/GPUToNVVM/GPUToNVVMPass.h index 051a53f9e503..7d031f47c197 100644 --- a/mlir/include/mlir/Conversion/GPUToNVVM/GPUToNVVMPass.h +++ b/mlir/include/mlir/Conversion/GPUToNVVM/GPUToNVVMPass.h @@ -16,7 +16,6 @@ namespace mlir { class LLVMTypeConverter; class ConversionTarget; class RewritePatternSet; -using OwningRewritePatternList = RewritePatternSet; template class OperationPass; diff --git a/mlir/include/mlir/Conversion/GPUToROCDL/GPUToROCDLPass.h b/mlir/include/mlir/Conversion/GPUToROCDL/GPUToROCDLPass.h index 83d8a08bb5a0..33b38cecf0fd 100644 --- a/mlir/include/mlir/Conversion/GPUToROCDL/GPUToROCDLPass.h +++ b/mlir/include/mlir/Conversion/GPUToROCDL/GPUToROCDLPass.h @@ -16,7 +16,6 @@ namespace mlir { class LLVMTypeConverter; class ConversionTarget; class RewritePatternSet; -using OwningRewritePatternList = RewritePatternSet; template class OperationPass; diff --git a/mlir/include/mlir/Conversion/LinalgToSPIRV/LinalgToSPIRV.h b/mlir/include/mlir/Conversion/LinalgToSPIRV/LinalgToSPIRV.h index 64b612ed6b12..cc1ca7192ae1 100644 --- a/mlir/include/mlir/Conversion/LinalgToSPIRV/LinalgToSPIRV.h +++ b/mlir/include/mlir/Conversion/LinalgToSPIRV/LinalgToSPIRV.h @@ -17,7 +17,6 @@ namespace mlir { class MLIRContext; class SPIRVTypeConverter; class RewritePatternSet; -using OwningRewritePatternList = RewritePatternSet; /// Appends to a pattern list additional patterns for translating Linalg ops to /// SPIR-V ops. diff --git a/mlir/include/mlir/Conversion/OpenMPToLLVM/ConvertOpenMPToLLVM.h b/mlir/include/mlir/Conversion/OpenMPToLLVM/ConvertOpenMPToLLVM.h index 5df05cbabe0d..3793c9199217 100644 --- a/mlir/include/mlir/Conversion/OpenMPToLLVM/ConvertOpenMPToLLVM.h +++ b/mlir/include/mlir/Conversion/OpenMPToLLVM/ConvertOpenMPToLLVM.h @@ -17,7 +17,6 @@ class ModuleOp; template class OperationPass; class RewritePatternSet; -using OwningRewritePatternList = RewritePatternSet; /// Populate the given list with patterns that convert from OpenMP to LLVM. void populateOpenMPToLLVMConversionPatterns(LLVMTypeConverter &converter, diff --git a/mlir/include/mlir/Conversion/SCFToGPU/SCFToGPU.h b/mlir/include/mlir/Conversion/SCFToGPU/SCFToGPU.h index d1221d17d768..83af4389af8c 100644 --- a/mlir/include/mlir/Conversion/SCFToGPU/SCFToGPU.h +++ b/mlir/include/mlir/Conversion/SCFToGPU/SCFToGPU.h @@ -18,7 +18,6 @@ class MLIRContext; class Value; class Operation; class RewritePatternSet; -using OwningRewritePatternList = RewritePatternSet; namespace scf { class ForOp; diff --git a/mlir/include/mlir/Conversion/SCFToSPIRV/SCFToSPIRV.h b/mlir/include/mlir/Conversion/SCFToSPIRV/SCFToSPIRV.h index 284500df796c..4effa7186ef3 100644 --- a/mlir/include/mlir/Conversion/SCFToSPIRV/SCFToSPIRV.h +++ b/mlir/include/mlir/Conversion/SCFToSPIRV/SCFToSPIRV.h @@ -21,7 +21,6 @@ class Pass; class SPIRVTypeConverter; struct ScfToSPIRVContextImpl; class RewritePatternSet; -using OwningRewritePatternList = RewritePatternSet; struct ScfToSPIRVContext { ScfToSPIRVContext(); diff --git a/mlir/include/mlir/Conversion/SCFToStandard/SCFToStandard.h b/mlir/include/mlir/Conversion/SCFToStandard/SCFToStandard.h index 880d4ae6e745..b29fdb72f7ec 100644 --- a/mlir/include/mlir/Conversion/SCFToStandard/SCFToStandard.h +++ b/mlir/include/mlir/Conversion/SCFToStandard/SCFToStandard.h @@ -17,7 +17,6 @@ struct LogicalResult; class Pass; class RewritePatternSet; -using OwningRewritePatternList = RewritePatternSet; /// Collect a set of patterns to lower from scf.for, scf.if, and /// loop.terminator to CFG operations within the Standard dialect, in particular diff --git a/mlir/include/mlir/Conversion/ShapeToStandard/ShapeToStandard.h b/mlir/include/mlir/Conversion/ShapeToStandard/ShapeToStandard.h index a26d4dd2e314..7dc81017946a 100644 --- a/mlir/include/mlir/Conversion/ShapeToStandard/ShapeToStandard.h +++ b/mlir/include/mlir/Conversion/ShapeToStandard/ShapeToStandard.h @@ -18,7 +18,6 @@ class ModuleOp; template class OperationPass; class RewritePatternSet; -using OwningRewritePatternList = RewritePatternSet; void populateShapeToStandardConversionPatterns(RewritePatternSet &patterns); diff --git a/mlir/include/mlir/Conversion/VectorToROCDL/VectorToROCDL.h b/mlir/include/mlir/Conversion/VectorToROCDL/VectorToROCDL.h index 2b935cdc3dab..bb65899387ce 100644 --- a/mlir/include/mlir/Conversion/VectorToROCDL/VectorToROCDL.h +++ b/mlir/include/mlir/Conversion/VectorToROCDL/VectorToROCDL.h @@ -16,7 +16,6 @@ class ModuleOp; template class OperationPass; class RewritePatternSet; -using OwningRewritePatternList = RewritePatternSet; /// Collect a set of patterns to convert from the GPU dialect to ROCDL. void populateVectorToROCDLConversionPatterns(LLVMTypeConverter &converter, diff --git a/mlir/include/mlir/Dialect/AMX/Transforms.h b/mlir/include/mlir/Dialect/AMX/Transforms.h index 16dff0df1381..19608dff6f16 100644 --- a/mlir/include/mlir/Dialect/AMX/Transforms.h +++ b/mlir/include/mlir/Dialect/AMX/Transforms.h @@ -14,7 +14,6 @@ namespace mlir { class LLVMConversionTarget; class LLVMTypeConverter; class RewritePatternSet; -using OwningRewritePatternList = RewritePatternSet; /// Collect a set of patterns to lower AMX ops to ops that map to LLVM /// intrinsics. diff --git a/mlir/include/mlir/Dialect/ArmSVE/Transforms.h b/mlir/include/mlir/Dialect/ArmSVE/Transforms.h index 980b1380da7b..dcc485789875 100644 --- a/mlir/include/mlir/Dialect/ArmSVE/Transforms.h +++ b/mlir/include/mlir/Dialect/ArmSVE/Transforms.h @@ -14,7 +14,6 @@ namespace mlir { class LLVMConversionTarget; class LLVMTypeConverter; class RewritePatternSet; -using OwningRewritePatternList = RewritePatternSet; /// Collect a set of patterns to lower ArmSVE ops to ops that map to LLVM /// intrinsics. diff --git a/mlir/include/mlir/Dialect/Linalg/Transforms/Transforms.h b/mlir/include/mlir/Dialect/Linalg/Transforms/Transforms.h index 61156c733594..bd258f44476b 100644 --- a/mlir/include/mlir/Dialect/Linalg/Transforms/Transforms.h +++ b/mlir/include/mlir/Dialect/Linalg/Transforms/Transforms.h @@ -1289,8 +1289,8 @@ LogicalResult peelAndCanonicalizeTiledLoop(RewriterBase &rewriter, /// global transformations, in a staged fashion: /// 1. the first stage consists of a list of FrozenRewritePatternSet. Each /// FrozenRewritePatternSet in this list is applied once, in order. -/// 2. the second stage consists of a single OwningRewritePattern that is -/// applied greedily until convergence. +/// 2. the second stage consists of a single RewritePattern that is applied +/// greedily until convergence. /// 3. the third stage consists of applying a lambda, generally used for /// non-local transformation effects. This allows creating custom fused /// transformations where patterns can be ordered and applied at a finer diff --git a/mlir/include/mlir/Dialect/MemRef/Transforms/ComposeSubView.h b/mlir/include/mlir/Dialect/MemRef/Transforms/ComposeSubView.h index 20aa1c02db17..6a487d902cce 100644 --- a/mlir/include/mlir/Dialect/MemRef/Transforms/ComposeSubView.h +++ b/mlir/include/mlir/Dialect/MemRef/Transforms/ComposeSubView.h @@ -16,11 +16,10 @@ namespace mlir { class MLIRContext; class RewritePatternSet; -using OwningRewritePatternList = RewritePatternSet; namespace memref { -void populateComposeSubViewPatterns(OwningRewritePatternList &patterns, +void populateComposeSubViewPatterns(RewritePatternSet &patterns, MLIRContext *context); } // namespace memref diff --git a/mlir/include/mlir/Dialect/SCF/Transforms.h b/mlir/include/mlir/Dialect/SCF/Transforms.h index 8286d70c6f9a..5ad7f7a1b782 100644 --- a/mlir/include/mlir/Dialect/SCF/Transforms.h +++ b/mlir/include/mlir/Dialect/SCF/Transforms.h @@ -27,7 +27,6 @@ class Region; class RewriterBase; class TypeConverter; class RewritePatternSet; -using OwningRewritePatternList = RewritePatternSet; class Operation; class Value; class ValueRange; diff --git a/mlir/include/mlir/Dialect/StandardOps/Transforms/FuncConversions.h b/mlir/include/mlir/Dialect/StandardOps/Transforms/FuncConversions.h index 6187d59e547e..8457805217be 100644 --- a/mlir/include/mlir/Dialect/StandardOps/Transforms/FuncConversions.h +++ b/mlir/include/mlir/Dialect/StandardOps/Transforms/FuncConversions.h @@ -25,7 +25,6 @@ class MLIRContext; class Operation; class TypeConverter; class RewritePatternSet; -using OwningRewritePatternList = RewritePatternSet; /// Add a pattern to the given pattern list to convert the operand and result /// types of a CallOp with the given type converter. diff --git a/mlir/include/mlir/Dialect/StandardOps/Transforms/Passes.h b/mlir/include/mlir/Dialect/StandardOps/Transforms/Passes.h index 3f723133b2a6..dea605f1ae1a 100644 --- a/mlir/include/mlir/Dialect/StandardOps/Transforms/Passes.h +++ b/mlir/include/mlir/Dialect/StandardOps/Transforms/Passes.h @@ -23,7 +23,6 @@ class GlobalCreator; } // namespace bufferization class RewritePatternSet; -using OwningRewritePatternList = RewritePatternSet; void populateStdBufferizePatterns( bufferization::BufferizeTypeConverter &typeConverter, diff --git a/mlir/include/mlir/Dialect/Tensor/Transforms/Passes.h b/mlir/include/mlir/Dialect/Tensor/Transforms/Passes.h index b62399ce21ae..f90d02bda22d 100644 --- a/mlir/include/mlir/Dialect/Tensor/Transforms/Passes.h +++ b/mlir/include/mlir/Dialect/Tensor/Transforms/Passes.h @@ -17,7 +17,6 @@ class BufferizeTypeConverter; } // namespace bufferization class RewritePatternSet; -using OwningRewritePatternList = RewritePatternSet; void populateTensorBufferizePatterns( bufferization::BufferizeTypeConverter &typeConverter, diff --git a/mlir/include/mlir/Dialect/Vector/VectorOps.h b/mlir/include/mlir/Dialect/Vector/VectorOps.h index 816ec204acfe..4bb2ca4fed0f 100644 --- a/mlir/include/mlir/Dialect/Vector/VectorOps.h +++ b/mlir/include/mlir/Dialect/Vector/VectorOps.h @@ -32,7 +32,6 @@ namespace mlir { class MLIRContext; class RewritePatternSet; -using OwningRewritePatternList = RewritePatternSet; namespace vector { class VectorDialect; diff --git a/mlir/include/mlir/Dialect/Vector/VectorTransforms.h b/mlir/include/mlir/Dialect/Vector/VectorTransforms.h index d43163e573bc..0f987aea24c5 100644 --- a/mlir/include/mlir/Dialect/Vector/VectorTransforms.h +++ b/mlir/include/mlir/Dialect/Vector/VectorTransforms.h @@ -18,8 +18,6 @@ class VectorTransferOpInterface; class RewritePatternSet; class RewriterBase; -using OwningRewritePatternList = RewritePatternSet; - namespace scf { class IfOp; } // namespace scf diff --git a/mlir/include/mlir/Dialect/X86Vector/Transforms.h b/mlir/include/mlir/Dialect/X86Vector/Transforms.h index f6b7f29dc776..fe98ebd955aa 100644 --- a/mlir/include/mlir/Dialect/X86Vector/Transforms.h +++ b/mlir/include/mlir/Dialect/X86Vector/Transforms.h @@ -17,7 +17,6 @@ class ImplicitLocOpBuilder; class LLVMConversionTarget; class LLVMTypeConverter; class RewritePatternSet; -using OwningRewritePatternList = RewritePatternSet; namespace x86vector { diff --git a/mlir/include/mlir/IR/OperationSupport.h b/mlir/include/mlir/IR/OperationSupport.h index 4e68a67ad1b7..7a055bf055c7 100644 --- a/mlir/include/mlir/IR/OperationSupport.h +++ b/mlir/include/mlir/IR/OperationSupport.h @@ -49,15 +49,13 @@ class Pattern; class Region; class ResultRange; class RewritePattern; +class RewritePatternSet; class Type; class Value; class ValueRange; template class ValueTypeRange; -class RewritePatternSet; -using OwningRewritePatternList = RewritePatternSet; - //===----------------------------------------------------------------------===// // OperationName //===----------------------------------------------------------------------===// diff --git a/mlir/lib/Conversion/GPUCommon/GPUToLLVMConversion.cpp b/mlir/lib/Conversion/GPUCommon/GPUToLLVMConversion.cpp index ab498da6e8cc..212453e8b358 100644 --- a/mlir/lib/Conversion/GPUCommon/GPUToLLVMConversion.cpp +++ b/mlir/lib/Conversion/GPUCommon/GPUToLLVMConversion.cpp @@ -848,7 +848,7 @@ mlir::createGpuToLLVMConversionPass() { } void mlir::populateGpuToLLVMConversionPatterns( - LLVMTypeConverter &converter, OwningRewritePatternList &patterns, + LLVMTypeConverter &converter, RewritePatternSet &patterns, StringRef gpuBinaryAnnotation) { converter.addConversion( [context = &converter.getContext()](gpu::AsyncTokenType type) -> Type { diff --git a/mlir/lib/Conversion/OpenACCToLLVM/OpenACCToLLVM.cpp b/mlir/lib/Conversion/OpenACCToLLVM/OpenACCToLLVM.cpp index fdff881a5721..43a49a59fca3 100644 --- a/mlir/lib/Conversion/OpenACCToLLVM/OpenACCToLLVM.cpp +++ b/mlir/lib/Conversion/OpenACCToLLVM/OpenACCToLLVM.cpp @@ -138,7 +138,7 @@ class LegalizeDataOpForLLVMTranslation : public ConvertOpToLLVMPattern { } // namespace void mlir::populateOpenACCToLLVMConversionPatterns( - LLVMTypeConverter &converter, OwningRewritePatternList &patterns) { + LLVMTypeConverter &converter, RewritePatternSet &patterns) { patterns.add>(converter); patterns.add>(converter); patterns.add>(converter); diff --git a/mlir/lib/Dialect/Arithmetic/IR/ArithmeticOps.cpp b/mlir/lib/Dialect/Arithmetic/IR/ArithmeticOps.cpp index 9beecb6f66d4..d2473ebbff40 100644 --- a/mlir/lib/Dialect/Arithmetic/IR/ArithmeticOps.cpp +++ b/mlir/lib/Dialect/Arithmetic/IR/ArithmeticOps.cpp @@ -209,7 +209,7 @@ OpFoldResult arith::AddIOp::fold(ArrayRef operands) { } void arith::AddIOp::getCanonicalizationPatterns( - OwningRewritePatternList &patterns, MLIRContext *context) { + RewritePatternSet &patterns, MLIRContext *context) { patterns.insert( context); } @@ -231,7 +231,7 @@ OpFoldResult arith::SubIOp::fold(ArrayRef operands) { } void arith::SubIOp::getCanonicalizationPatterns( - OwningRewritePatternList &patterns, MLIRContext *context) { + RewritePatternSet &patterns, MLIRContext *context) { patterns.insert(context); @@ -567,7 +567,7 @@ OpFoldResult arith::XOrIOp::fold(ArrayRef operands) { } void arith::XOrIOp::getCanonicalizationPatterns( - OwningRewritePatternList &patterns, MLIRContext *context) { + RewritePatternSet &patterns, MLIRContext *context) { patterns.insert(context); } @@ -846,7 +846,7 @@ bool arith::ExtSIOp::areCastCompatible(TypeRange inputs, TypeRange outputs) { } void arith::ExtSIOp::getCanonicalizationPatterns( - OwningRewritePatternList &patterns, MLIRContext *context) { + RewritePatternSet &patterns, MLIRContext *context) { patterns.insert(context); } @@ -926,7 +926,7 @@ bool arith::TruncFOp::areCastCompatible(TypeRange inputs, TypeRange outputs) { //===----------------------------------------------------------------------===// void arith::AndIOp::getCanonicalizationPatterns( - OwningRewritePatternList &patterns, MLIRContext *context) { + RewritePatternSet &patterns, MLIRContext *context) { patterns.insert(context); } @@ -935,7 +935,7 @@ void arith::AndIOp::getCanonicalizationPatterns( //===----------------------------------------------------------------------===// void arith::OrIOp::getCanonicalizationPatterns( - OwningRewritePatternList &patterns, MLIRContext *context) { + RewritePatternSet &patterns, MLIRContext *context) { patterns.insert(context); } @@ -1074,7 +1074,7 @@ OpFoldResult arith::IndexCastOp::fold(ArrayRef operands) { } void arith::IndexCastOp::getCanonicalizationPatterns( - OwningRewritePatternList &patterns, MLIRContext *context) { + RewritePatternSet &patterns, MLIRContext *context) { patterns.insert(context); } @@ -1123,7 +1123,7 @@ OpFoldResult arith::BitcastOp::fold(ArrayRef operands) { } void arith::BitcastOp::getCanonicalizationPatterns( - OwningRewritePatternList &patterns, MLIRContext *context) { + RewritePatternSet &patterns, MLIRContext *context) { patterns.insert(context); } diff --git a/mlir/lib/Dialect/ArmSVE/Transforms/LegalizeForLLVMExport.cpp b/mlir/lib/Dialect/ArmSVE/Transforms/LegalizeForLLVMExport.cpp index 95bc3e6b2959..0145ec37422d 100644 --- a/mlir/lib/Dialect/ArmSVE/Transforms/LegalizeForLLVMExport.cpp +++ b/mlir/lib/Dialect/ArmSVE/Transforms/LegalizeForLLVMExport.cpp @@ -67,7 +67,7 @@ using ScalableMaskedDivFOpLowering = /// Populate the given list with patterns that convert from ArmSVE to LLVM. void mlir::populateArmSVELegalizeForLLVMExportPatterns( - LLVMTypeConverter &converter, OwningRewritePatternList &patterns) { + LLVMTypeConverter &converter, RewritePatternSet &patterns) { // Populate conversion patterns // clang-format off diff --git a/mlir/lib/Dialect/Bufferization/IR/BufferizationOps.cpp b/mlir/lib/Dialect/Bufferization/IR/BufferizationOps.cpp index 93770c9da5aa..f1ec7bbdead2 100644 --- a/mlir/lib/Dialect/Bufferization/IR/BufferizationOps.cpp +++ b/mlir/lib/Dialect/Bufferization/IR/BufferizationOps.cpp @@ -102,7 +102,7 @@ struct SimplifyClones : public OpRewritePattern { } // namespace -void CloneOp::getCanonicalizationPatterns(OwningRewritePatternList &results, +void CloneOp::getCanonicalizationPatterns(RewritePatternSet &results, MLIRContext *context) { results.insert(context); } diff --git a/mlir/lib/Dialect/Bufferization/Transforms/Bufferize.cpp b/mlir/lib/Dialect/Bufferization/Transforms/Bufferize.cpp index 07bd8fdbb0bb..eb7f0dedca02 100644 --- a/mlir/lib/Dialect/Bufferization/Transforms/Bufferize.cpp +++ b/mlir/lib/Dialect/Bufferization/Transforms/Bufferize.cpp @@ -205,7 +205,7 @@ checkBufferizationResult(Operation *op, const BufferizationOptions &options) { LogicalResult bufferization::bufferizeOp(Operation *op, const BufferizationState &state) { // Bufferize the op and its nested ops. - OwningRewritePatternList patterns(op->getContext()); + RewritePatternSet patterns(op->getContext()); patterns.add(op->getContext(), state); if (failed(applyPatternsAndFoldGreedily(op, std::move(patterns)))) return failure(); diff --git a/mlir/lib/Dialect/Linalg/IR/LinalgOps.cpp b/mlir/lib/Dialect/Linalg/IR/LinalgOps.cpp index d7c5c622b1a6..facf303fed15 100644 --- a/mlir/lib/Dialect/Linalg/IR/LinalgOps.cpp +++ b/mlir/lib/Dialect/Linalg/IR/LinalgOps.cpp @@ -1753,7 +1753,7 @@ struct TiledLoopResultsFolder : public OpRewritePattern { }; } // namespace -void TiledLoopOp::getCanonicalizationPatterns(OwningRewritePatternList &results, +void TiledLoopOp::getCanonicalizationPatterns(RewritePatternSet &results, MLIRContext *context) { results.insert, diff --git a/mlir/lib/Dialect/MemRef/Transforms/ComposeSubView.cpp b/mlir/lib/Dialect/MemRef/Transforms/ComposeSubView.cpp index 29ba5060d167..8de484c3b86e 100644 --- a/mlir/lib/Dialect/MemRef/Transforms/ComposeSubView.cpp +++ b/mlir/lib/Dialect/MemRef/Transforms/ComposeSubView.cpp @@ -128,6 +128,6 @@ struct ComposeSubViewOpPattern : public OpRewritePattern { } // namespace void mlir::memref::populateComposeSubViewPatterns( - OwningRewritePatternList &patterns, MLIRContext *context) { + RewritePatternSet &patterns, MLIRContext *context) { patterns.insert(context); } diff --git a/mlir/lib/Dialect/SCF/SCF.cpp b/mlir/lib/Dialect/SCF/SCF.cpp index edae94cc9e74..382e3c662009 100644 --- a/mlir/lib/Dialect/SCF/SCF.cpp +++ b/mlir/lib/Dialect/SCF/SCF.cpp @@ -2537,7 +2537,7 @@ struct WhileUnusedArg : public OpRewritePattern { }; } // namespace -void WhileOp::getCanonicalizationPatterns(OwningRewritePatternList &results, +void WhileOp::getCanonicalizationPatterns(RewritePatternSet &results, MLIRContext *context) { results.insert(context); diff --git a/mlir/lib/Dialect/StandardOps/IR/Ops.cpp b/mlir/lib/Dialect/StandardOps/IR/Ops.cpp index ffe155ad214e..8d96f31b0784 100644 --- a/mlir/lib/Dialect/StandardOps/IR/Ops.cpp +++ b/mlir/lib/Dialect/StandardOps/IR/Ops.cpp @@ -764,7 +764,7 @@ struct SelectToExtUI : public OpRewritePattern { } }; -void SelectOp::getCanonicalizationPatterns(OwningRewritePatternList &results, +void SelectOp::getCanonicalizationPatterns(RewritePatternSet &results, MLIRContext *context) { results.insert(context); } diff --git a/mlir/lib/Dialect/Tosa/IR/TosaOps.cpp b/mlir/lib/Dialect/Tosa/IR/TosaOps.cpp index af8fa306d765..f437eb455ca8 100644 --- a/mlir/lib/Dialect/Tosa/IR/TosaOps.cpp +++ b/mlir/lib/Dialect/Tosa/IR/TosaOps.cpp @@ -129,7 +129,7 @@ struct ConcatOptimization : public OpRewritePattern { } }; -void ConcatOp::getCanonicalizationPatterns(OwningRewritePatternList &results, +void ConcatOp::getCanonicalizationPatterns(RewritePatternSet &results, MLIRContext *context) { results.insert(context); } @@ -187,7 +187,7 @@ struct ReshapeConstOptimization : public OpRewritePattern { } }; -void ReshapeOp::getCanonicalizationPatterns(OwningRewritePatternList &results, +void ReshapeOp::getCanonicalizationPatterns(RewritePatternSet &results, MLIRContext *context) { results.insert(context); results.insert(context); @@ -284,7 +284,7 @@ struct NoOpOptimization : public OpRewritePattern { } }; -void TransposeOp::getCanonicalizationPatterns(OwningRewritePatternList &results, +void TransposeOp::getCanonicalizationPatterns(RewritePatternSet &results, MLIRContext *context) { results.insert(context); results.insert(context); @@ -322,7 +322,7 @@ struct AddZeroOptimization : public OpRewritePattern { } }; -void AddOp::getCanonicalizationPatterns(OwningRewritePatternList &results, +void AddOp::getCanonicalizationPatterns(RewritePatternSet &results, MLIRContext *context) { results.insert(context); } @@ -371,7 +371,7 @@ struct MulOneOptimization : public OpRewritePattern { } }; -void MulOp::getCanonicalizationPatterns(OwningRewritePatternList &results, +void MulOp::getCanonicalizationPatterns(RewritePatternSet &results, MLIRContext *context) { results.insert(context); } @@ -418,7 +418,7 @@ struct MaterializePadValue : public OpRewritePattern { } }; -void PadOp::getCanonicalizationPatterns(OwningRewritePatternList &results, +void PadOp::getCanonicalizationPatterns(RewritePatternSet &results, MLIRContext *context) { results.insert(context); } @@ -453,7 +453,7 @@ struct MaxPool2dIsNoOp : public OpRewritePattern { } }; -void MaxPool2dOp::getCanonicalizationPatterns(OwningRewritePatternList &results, +void MaxPool2dOp::getCanonicalizationPatterns(RewritePatternSet &results, MLIRContext *context) { results.insert(context); } @@ -556,7 +556,7 @@ struct ClampClampOptimization : public OpRewritePattern { } }; -void ClampOp::getCanonicalizationPatterns(OwningRewritePatternList &results, +void ClampOp::getCanonicalizationPatterns(RewritePatternSet &results, MLIRContext *context) { results.insert(context); results.insert(context); diff --git a/mlir/test/lib/Dialect/Linalg/TestLinalgDistribution.cpp b/mlir/test/lib/Dialect/Linalg/TestLinalgDistribution.cpp index cabb23d479af..342fed37ad60 100644 --- a/mlir/test/lib/Dialect/Linalg/TestLinalgDistribution.cpp +++ b/mlir/test/lib/Dialect/Linalg/TestLinalgDistribution.cpp @@ -53,7 +53,7 @@ struct TestLinalgDistribution void TestLinalgDistribution::runOnOperation() { auto funcOp = getOperation(); - OwningRewritePatternList distributeTiledLoopsPatterns(&getContext()); + RewritePatternSet distributeTiledLoopsPatterns(&getContext()); populateLinalgDistributeTiledLoopPattern( distributeTiledLoopsPatterns, getDistributionOptions(), LinalgTransformationFilter( diff --git a/mlir/test/lib/Dialect/MemRef/TestComposeSubView.cpp b/mlir/test/lib/Dialect/MemRef/TestComposeSubView.cpp index 20add4cc94c8..6431cc4e459e 100644 --- a/mlir/test/lib/Dialect/MemRef/TestComposeSubView.cpp +++ b/mlir/test/lib/Dialect/MemRef/TestComposeSubView.cpp @@ -34,7 +34,7 @@ void TestComposeSubViewPass::getDependentDialects( } void TestComposeSubViewPass::runOnOperation() { - OwningRewritePatternList patterns(&getContext()); + RewritePatternSet patterns(&getContext()); memref::populateComposeSubViewPatterns(patterns, &getContext()); (void)applyPatternsAndFoldGreedily(getOperation(), std::move(patterns)); }