diff --git a/mlir/include/mlir/Conversion/AffineToStandard/AffineToStandard.h b/mlir/include/mlir/Conversion/AffineToStandard/AffineToStandard.h --- a/mlir/include/mlir/Conversion/AffineToStandard/AffineToStandard.h +++ b/mlir/include/mlir/Conversion/AffineToStandard/AffineToStandard.h @@ -24,8 +24,8 @@ class Value; class ValueRange; -// Owning list of rewriting patterns. -class OwningRewritePatternList; +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/ArmSVEToLLVM/ArmSVEToLLVM.h b/mlir/include/mlir/Conversion/ArmSVEToLLVM/ArmSVEToLLVM.h --- a/mlir/include/mlir/Conversion/ArmSVEToLLVM/ArmSVEToLLVM.h +++ b/mlir/include/mlir/Conversion/ArmSVEToLLVM/ArmSVEToLLVM.h @@ -12,7 +12,8 @@ namespace mlir { class LLVMTypeConverter; -class OwningRewritePatternList; +class RewritePatternSet; +using OwningRewritePatternList = RewritePatternSet; /// Collect a set of patterns to convert from the ArmSVE dialect to LLVM. void populateArmSVEToLLVMConversionPatterns(LLVMTypeConverter &converter, diff --git a/mlir/include/mlir/Conversion/AsyncToLLVM/AsyncToLLVM.h b/mlir/include/mlir/Conversion/AsyncToLLVM/AsyncToLLVM.h --- a/mlir/include/mlir/Conversion/AsyncToLLVM/AsyncToLLVM.h +++ b/mlir/include/mlir/Conversion/AsyncToLLVM/AsyncToLLVM.h @@ -18,8 +18,9 @@ template class OperationPass; class MLIRContext; -class OwningRewritePatternList; 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 --- a/mlir/include/mlir/Conversion/GPUCommon/GPUCommonPass.h +++ b/mlir/include/mlir/Conversion/GPUCommon/GPUCommonPass.h @@ -24,7 +24,8 @@ struct LogicalResult; class ModuleOp; class Operation; -class OwningRewritePatternList; +class RewritePatternSet; +using OwningRewritePatternList = RewritePatternSet; template class OperationPass; diff --git a/mlir/include/mlir/Conversion/GPUToNVVM/GPUToNVVMPass.h b/mlir/include/mlir/Conversion/GPUToNVVM/GPUToNVVMPass.h --- a/mlir/include/mlir/Conversion/GPUToNVVM/GPUToNVVMPass.h +++ b/mlir/include/mlir/Conversion/GPUToNVVM/GPUToNVVMPass.h @@ -13,10 +13,12 @@ namespace mlir { class LLVMTypeConverter; -class OwningRewritePatternList; class ConversionTarget; +class RewritePatternSet; +using OwningRewritePatternList = RewritePatternSet; -template class OperationPass; +template +class OperationPass; namespace gpu { class GPUModuleOp; diff --git a/mlir/include/mlir/Conversion/GPUToROCDL/GPUToROCDLPass.h b/mlir/include/mlir/Conversion/GPUToROCDL/GPUToROCDLPass.h --- a/mlir/include/mlir/Conversion/GPUToROCDL/GPUToROCDLPass.h +++ b/mlir/include/mlir/Conversion/GPUToROCDL/GPUToROCDLPass.h @@ -13,8 +13,9 @@ namespace mlir { class LLVMTypeConverter; -class OwningRewritePatternList; 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 --- a/mlir/include/mlir/Conversion/LinalgToSPIRV/LinalgToSPIRV.h +++ b/mlir/include/mlir/Conversion/LinalgToSPIRV/LinalgToSPIRV.h @@ -15,8 +15,9 @@ namespace mlir { class MLIRContext; -class OwningRewritePatternList; 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 --- a/mlir/include/mlir/Conversion/OpenMPToLLVM/ConvertOpenMPToLLVM.h +++ b/mlir/include/mlir/Conversion/OpenMPToLLVM/ConvertOpenMPToLLVM.h @@ -8,7 +8,7 @@ #ifndef MLIR_CONVERSION_OPENMPTOLLVM_OPENMPTOLLVM_H_ #define MLIR_CONVERSION_OPENMPTOLLVM_OPENMPTOLLVM_H_ -#include +#include namespace mlir { class LLVMTypeConverter; @@ -16,7 +16,8 @@ class ModuleOp; template class OperationPass; -class OwningRewritePatternList; +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 --- a/mlir/include/mlir/Conversion/SCFToGPU/SCFToGPU.h +++ b/mlir/include/mlir/Conversion/SCFToGPU/SCFToGPU.h @@ -15,8 +15,9 @@ class ConversionTarget; struct LogicalResult; class MLIRContext; -class OwningRewritePatternList; class Value; +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 --- a/mlir/include/mlir/Conversion/SCFToSPIRV/SCFToSPIRV.h +++ b/mlir/include/mlir/Conversion/SCFToSPIRV/SCFToSPIRV.h @@ -18,9 +18,10 @@ class Pass; // Owning list of rewriting patterns. -class OwningRewritePatternList; 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 --- a/mlir/include/mlir/Conversion/SCFToStandard/SCFToStandard.h +++ b/mlir/include/mlir/Conversion/SCFToStandard/SCFToStandard.h @@ -15,10 +15,9 @@ namespace mlir { struct LogicalResult; class Pass; -class RewritePattern; -// Owning list of rewriting patterns. -class OwningRewritePatternList; +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 --- a/mlir/include/mlir/Conversion/ShapeToStandard/ShapeToStandard.h +++ b/mlir/include/mlir/Conversion/ShapeToStandard/ShapeToStandard.h @@ -17,7 +17,8 @@ class ModuleOp; template class OperationPass; -class OwningRewritePatternList; +class RewritePatternSet; +using OwningRewritePatternList = RewritePatternSet; void populateShapeToStandardConversionPatterns( OwningRewritePatternList &patterns); diff --git a/mlir/include/mlir/Conversion/StandardToLLVM/ConvertStandardToLLVMPass.h b/mlir/include/mlir/Conversion/StandardToLLVM/ConvertStandardToLLVMPass.h --- a/mlir/include/mlir/Conversion/StandardToLLVM/ConvertStandardToLLVMPass.h +++ b/mlir/include/mlir/Conversion/StandardToLLVM/ConvertStandardToLLVMPass.h @@ -18,7 +18,8 @@ class ModuleOp; template class OperationPass; -class OwningRewritePatternList; +class RewritePatternSet; +using OwningRewritePatternList = RewritePatternSet; /// Value to pass as bitwidth for the index type when the converter is expected /// to derive the bitwidth from the LLVM data layout. diff --git a/mlir/include/mlir/Conversion/VectorToROCDL/VectorToROCDL.h b/mlir/include/mlir/Conversion/VectorToROCDL/VectorToROCDL.h --- a/mlir/include/mlir/Conversion/VectorToROCDL/VectorToROCDL.h +++ b/mlir/include/mlir/Conversion/VectorToROCDL/VectorToROCDL.h @@ -12,10 +12,11 @@ namespace mlir { class LLVMTypeConverter; -class OwningRewritePatternList; 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( diff --git a/mlir/include/mlir/Conversion/VectorToSCF/VectorToSCF.h b/mlir/include/mlir/Conversion/VectorToSCF/VectorToSCF.h --- a/mlir/include/mlir/Conversion/VectorToSCF/VectorToSCF.h +++ b/mlir/include/mlir/Conversion/VectorToSCF/VectorToSCF.h @@ -13,8 +13,9 @@ namespace mlir { class MLIRContext; -class OwningRewritePatternList; class Pass; +class RewritePatternSet; +using OwningRewritePatternList = RewritePatternSet; /// Control whether unrolling is used when lowering vector transfer ops to SCF. /// diff --git a/mlir/include/mlir/Dialect/AMX/Transforms.h b/mlir/include/mlir/Dialect/AMX/Transforms.h --- a/mlir/include/mlir/Dialect/AMX/Transforms.h +++ b/mlir/include/mlir/Dialect/AMX/Transforms.h @@ -13,7 +13,8 @@ class LLVMConversionTarget; class LLVMTypeConverter; -class OwningRewritePatternList; +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/AVX512/Transforms.h b/mlir/include/mlir/Dialect/AVX512/Transforms.h --- a/mlir/include/mlir/Dialect/AVX512/Transforms.h +++ b/mlir/include/mlir/Dialect/AVX512/Transforms.h @@ -13,7 +13,8 @@ class LLVMConversionTarget; class LLVMTypeConverter; -class OwningRewritePatternList; +class RewritePatternSet; +using OwningRewritePatternList = RewritePatternSet; /// Collect a set of patterns to lower AVX512 ops to ops that map to LLVM /// intrinsics. diff --git a/mlir/include/mlir/Dialect/Math/Transforms/Passes.h b/mlir/include/mlir/Dialect/Math/Transforms/Passes.h --- a/mlir/include/mlir/Dialect/Math/Transforms/Passes.h +++ b/mlir/include/mlir/Dialect/Math/Transforms/Passes.h @@ -11,12 +11,11 @@ namespace mlir { -class OwningRewritePatternList; +class RewritePatternSet; -void populateExpandTanhPattern(OwningRewritePatternList &patterns); +void populateExpandTanhPattern(RewritePatternSet &patterns); -void populateMathPolynomialApproximationPatterns( - OwningRewritePatternList &patterns); +void populateMathPolynomialApproximationPatterns(RewritePatternSet &patterns); } // namespace mlir diff --git a/mlir/include/mlir/Dialect/SCF/Transforms.h b/mlir/include/mlir/Dialect/SCF/Transforms.h --- a/mlir/include/mlir/Dialect/SCF/Transforms.h +++ b/mlir/include/mlir/Dialect/SCF/Transforms.h @@ -19,9 +19,10 @@ class ConversionTarget; class MLIRContext; -class OwningRewritePatternList; class Region; class TypeConverter; +class RewritePatternSet; +using OwningRewritePatternList = RewritePatternSet; namespace scf { diff --git a/mlir/include/mlir/Dialect/StandardOps/Transforms/FuncConversions.h b/mlir/include/mlir/Dialect/StandardOps/Transforms/FuncConversions.h --- a/mlir/include/mlir/Dialect/StandardOps/Transforms/FuncConversions.h +++ b/mlir/include/mlir/Dialect/StandardOps/Transforms/FuncConversions.h @@ -19,8 +19,9 @@ class ConversionTarget; class MLIRContext; class Operation; -class OwningRewritePatternList; 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 --- a/mlir/include/mlir/Dialect/StandardOps/Transforms/Passes.h +++ b/mlir/include/mlir/Dialect/StandardOps/Transforms/Passes.h @@ -19,7 +19,8 @@ namespace mlir { -class OwningRewritePatternList; +class RewritePatternSet; +using OwningRewritePatternList = RewritePatternSet; void populateStdBufferizePatterns(BufferizeTypeConverter &typeConverter, OwningRewritePatternList &patterns); diff --git a/mlir/include/mlir/Dialect/Tensor/Transforms/Passes.h b/mlir/include/mlir/Dialect/Tensor/Transforms/Passes.h --- a/mlir/include/mlir/Dialect/Tensor/Transforms/Passes.h +++ b/mlir/include/mlir/Dialect/Tensor/Transforms/Passes.h @@ -14,7 +14,8 @@ namespace mlir { -class OwningRewritePatternList; +class RewritePatternSet; +using OwningRewritePatternList = RewritePatternSet; void populateTensorBufferizePatterns(BufferizeTypeConverter &typeConverter, OwningRewritePatternList &patterns); diff --git a/mlir/include/mlir/Dialect/Vector/VectorOps.h b/mlir/include/mlir/Dialect/Vector/VectorOps.h --- a/mlir/include/mlir/Dialect/Vector/VectorOps.h +++ b/mlir/include/mlir/Dialect/Vector/VectorOps.h @@ -28,7 +28,8 @@ namespace mlir { class MLIRContext; -class OwningRewritePatternList; +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 --- a/mlir/include/mlir/Dialect/Vector/VectorTransforms.h +++ b/mlir/include/mlir/Dialect/Vector/VectorTransforms.h @@ -16,8 +16,9 @@ namespace mlir { class MLIRContext; -class OwningRewritePatternList; class VectorTransferOpInterface; +class RewritePatternSet; +using OwningRewritePatternList = RewritePatternSet; namespace scf { class IfOp; diff --git a/mlir/include/mlir/IR/OperationSupport.h b/mlir/include/mlir/IR/OperationSupport.h --- a/mlir/include/mlir/IR/OperationSupport.h +++ b/mlir/include/mlir/IR/OperationSupport.h @@ -51,9 +51,11 @@ class Type; class Value; class ValueRange; -template class ValueTypeRange; +template +class ValueTypeRange; -class OwningRewritePatternList; +class RewritePatternSet; +using OwningRewritePatternList = RewritePatternSet; //===----------------------------------------------------------------------===// // AbstractOperation @@ -132,12 +134,14 @@ /// Returns an instance of the concept object for the given interface if it /// was registered to this operation, null otherwise. This should not be used /// directly. - template typename T::Concept *getInterface() const { + template + typename T::Concept *getInterface() const { return interfaceMap.lookup(); } /// Returns true if the operation has a particular trait. - template