diff --git a/compiler/src/iree/compiler/Dialect/Encoding/IR/EncodingDialect.cpp b/compiler/src/iree/compiler/Dialect/Encoding/IR/EncodingDialect.cpp index 2df61c116745..abbde6debfa9 100644 --- a/compiler/src/iree/compiler/Dialect/Encoding/IR/EncodingDialect.cpp +++ b/compiler/src/iree/compiler/Dialect/Encoding/IR/EncodingDialect.cpp @@ -28,7 +28,7 @@ namespace mlir::iree_compiler::IREE::Encoding { namespace { // Used for custom printing support. -struct EncodingOpAsmInterface : public OpAsmDialectInterface { +struct EncodingOpAsmInterface : OpAsmDialectInterface { using OpAsmDialectInterface::OpAsmDialectInterface; // Hooks for getting an alias identifier alias for a given symbol, that is // not necessarily a part of this dialect. The identifier is used in place @@ -45,7 +45,7 @@ struct EncodingOpAsmInterface : public OpAsmDialectInterface { }; // Used to control inlining behavior. -struct EncodingInlinerInterface : public DialectInlinerInterface { +struct EncodingInlinerInterface : DialectInlinerInterface { using DialectInlinerInterface::DialectInlinerInterface; bool isLegalToInline(Operation *call, Operation *callable, diff --git a/compiler/src/iree/compiler/Dialect/Flow/Conversion/TensorToFlow/Patterns.cpp b/compiler/src/iree/compiler/Dialect/Flow/Conversion/TensorToFlow/Patterns.cpp index c4600d8dc2fd..eaed0d57bc8e 100644 --- a/compiler/src/iree/compiler/Dialect/Flow/Conversion/TensorToFlow/Patterns.cpp +++ b/compiler/src/iree/compiler/Dialect/Flow/Conversion/TensorToFlow/Patterns.cpp @@ -28,8 +28,7 @@ namespace { /// /// This is expected to improve performance because we can use DMA /// functionalities for the fill, instead of dispatching kernels. -struct ConvertLinalgFillPattern final - : public OpRewritePattern { +struct ConvertLinalgFillPattern final : OpRewritePattern { using Base::Base; LogicalResult matchAndRewrite(linalg::FillOp fillOp, @@ -49,7 +48,7 @@ struct ConvertLinalgFillPattern final /// Convert tensor.insert_slice ops into flow.tensor.update ops where possible. struct ConvertTensorInsertSlicePattern - : public OpRewritePattern { + : OpRewritePattern { using Base::Base; LogicalResult matchAndRewrite(tensor::InsertSliceOp insertOp, PatternRewriter &rewriter) const override { @@ -58,7 +57,7 @@ struct ConvertTensorInsertSlicePattern }; /// Convert tensor.insert ops into flow.tensor.store ops where possible. -struct ConvertTensorInsertPattern : public OpRewritePattern { +struct ConvertTensorInsertPattern : OpRewritePattern { using Base::Base; LogicalResult matchAndRewrite(tensor::InsertOp insertOp, PatternRewriter &rewriter) const override { @@ -74,7 +73,7 @@ struct ConvertTensorInsertPattern : public OpRewritePattern { /// Convert tensor.extract_slice ops into flow.tensor.slice ops where possible. struct ConvertTensorExtractSlicePattern - : public OpRewritePattern { + : OpRewritePattern { using Base::Base; LogicalResult matchAndRewrite(tensor::ExtractSliceOp sliceOp, PatternRewriter &rewriter) const override { @@ -82,8 +81,7 @@ struct ConvertTensorExtractSlicePattern } }; -struct ConvertTensorExtractPattern - : public OpRewritePattern { +struct ConvertTensorExtractPattern : OpRewritePattern { using Base::Base; LogicalResult matchAndRewrite(tensor::ExtractOp op, @@ -97,8 +95,7 @@ struct ConvertTensorExtractPattern } }; -struct ConvertTensorExtBitcastPattern - : public OpRewritePattern { +struct ConvertTensorExtBitcastPattern : OpRewritePattern { using Base::Base; LogicalResult matchAndRewrite(TensorExt::BitCastOp op, PatternRewriter &rewriter) const override { @@ -112,8 +109,7 @@ struct ConvertTensorExtBitcastPattern } }; -struct ConvertTensorBitcastPattern - : public OpRewritePattern { +struct ConvertTensorBitcastPattern : OpRewritePattern { using Base::Base; LogicalResult matchAndRewrite(tensor::BitcastOp op, PatternRewriter &rewriter) const override { @@ -129,7 +125,7 @@ struct ConvertTensorBitcastPattern } }; -struct ConvertTensorCastPattern : public OpRewritePattern { +struct ConvertTensorCastPattern : OpRewritePattern { using Base::Base; LogicalResult matchAndRewrite(tensor::CastOp op, PatternRewriter &rewriter) const override { @@ -193,7 +189,7 @@ struct ConvertTensorCastPattern : public OpRewritePattern { } }; -struct ConvertTensorConcatPattern : public OpRewritePattern { +struct ConvertTensorConcatPattern : OpRewritePattern { using Base::Base; LogicalResult matchAndRewrite(tensor::ConcatOp concatOp, @@ -276,7 +272,7 @@ struct ConvertTensorConcatPattern : public OpRewritePattern { }; struct ConvertTensorFromElementsPattern - : public OpRewritePattern { + : OpRewritePattern { using Base::Base; LogicalResult matchAndRewrite(tensor::FromElementsOp op, PatternRewriter &rewriter) const override { @@ -337,7 +333,7 @@ static SmallVector getDynamicTensorSizes(OpBuilder &builder, /// Convert tensor.reshape ops into flow.tensor.reshape ops where possible. struct ConvertTensorDialectReshapeOpPattern - : public OpRewritePattern { + : OpRewritePattern { using Base::Base; LogicalResult matchAndRewrite(tensor::ReshapeOp op, PatternRewriter &rewriter) const override { @@ -383,7 +379,7 @@ struct ConvertTensorDialectReshapeOpPattern /// Converts linalg.tensor_reshape operations into flow.tensor.reshape /// operations. template -struct ConvertTensorReshapePattern : public OpRewritePattern { +struct ConvertTensorReshapePattern : OpRewritePattern { using OpRewritePattern::OpRewritePattern; LogicalResult matchAndRewrite(TensorReshapeOp reshapeOp, diff --git a/compiler/src/iree/compiler/Dialect/Flow/IR/FlowDialect.cpp b/compiler/src/iree/compiler/Dialect/Flow/IR/FlowDialect.cpp index dd78f836a79d..2e6f2979d998 100644 --- a/compiler/src/iree/compiler/Dialect/Flow/IR/FlowDialect.cpp +++ b/compiler/src/iree/compiler/Dialect/Flow/IR/FlowDialect.cpp @@ -24,7 +24,7 @@ namespace mlir::iree_compiler::IREE::Flow { namespace { // Used to control inlining behavior. -struct FlowInlinerInterface : public DialectInlinerInterface { +struct FlowInlinerInterface : DialectInlinerInterface { using DialectInlinerInterface::DialectInlinerInterface; bool isLegalToInline(Operation *call, Operation *callable, @@ -45,7 +45,7 @@ struct FlowInlinerInterface : public DialectInlinerInterface { } }; -struct FlowFolderInterface : public DialectFoldInterface { +struct FlowFolderInterface : DialectFoldInterface { using DialectFoldInterface::DialectFoldInterface; bool shouldMaterializeInto(Region *region) const override { diff --git a/compiler/src/iree/compiler/Dialect/Flow/IR/FlowOpFolders.cpp b/compiler/src/iree/compiler/Dialect/Flow/IR/FlowOpFolders.cpp index 4ca0e57124ac..76b03157eeba 100644 --- a/compiler/src/iree/compiler/Dialect/Flow/IR/FlowOpFolders.cpp +++ b/compiler/src/iree/compiler/Dialect/Flow/IR/FlowOpFolders.cpp @@ -45,7 +45,7 @@ namespace { // This is to support ops that are "pure" but can't be marked as such because // the MLIR CSE pass would deduplicate them. template -struct ElideUnusedOp : public OpRewritePattern { +struct ElideUnusedOp : OpRewritePattern { using OpRewritePattern::OpRewritePattern; LogicalResult matchAndRewrite(Op op, PatternRewriter &rewriter) const override { @@ -88,7 +88,7 @@ static bool isTensorResultZeroElements(Value value) { } template -struct ReplaceOpIfTensorOperandZeroElements : public OpRewritePattern { +struct ReplaceOpIfTensorOperandZeroElements : OpRewritePattern { using OpRewritePattern::OpRewritePattern; LogicalResult matchAndRewrite(Op op, PatternRewriter &rewriter) const override { @@ -105,7 +105,7 @@ struct ReplaceOpIfTensorOperandZeroElements : public OpRewritePattern { }; template -struct ReplaceOpIfTensorResultZeroElements : public OpRewritePattern { +struct ReplaceOpIfTensorResultZeroElements : OpRewritePattern { using OpRewritePattern::OpRewritePattern; LogicalResult matchAndRewrite(Op op, PatternRewriter &rewriter) const override { @@ -121,7 +121,7 @@ struct ReplaceOpIfTensorResultZeroElements : public OpRewritePattern { }; template -struct ReplaceOpIfTensorOperandEmpty : public OpRewritePattern { +struct ReplaceOpIfTensorOperandEmpty : OpRewritePattern { using OpRewritePattern::OpRewritePattern; LogicalResult matchAndRewrite(Op op, PatternRewriter &rewriter) const override { @@ -211,7 +211,7 @@ dedupAndGetOldToNewPosMapping(ValueRange values) { } struct ReplaceDispatchResultIfZeroElements - : public OpRewritePattern { + : OpRewritePattern { using Base::Base; LogicalResult matchAndRewrite(DispatchWorkgroupsOp op, PatternRewriter &rewriter) const override { @@ -236,8 +236,7 @@ struct ReplaceDispatchResultIfZeroElements /// Deduplicate redundant workload values of a dispatch.workgroups op. This /// requires modifying the `count` region of the op to match the new workloads. -struct ElideRedundantWorkloadValues - : public OpRewritePattern { +struct ElideRedundantWorkloadValues : OpRewritePattern { using Base::Base; LogicalResult matchAndRewrite(DispatchWorkgroupsOp op, PatternRewriter &rewriter) const override { @@ -393,8 +392,7 @@ OpFoldResult DispatchTieShapeOp::fold(FoldAdaptor operands) { namespace { -struct DeduplicateDispatchEntryRefs final - : public OpRewritePattern { +struct DeduplicateDispatchEntryRefs final : OpRewritePattern { using Base::Base; LogicalResult matchAndRewrite(DispatchOp dispatchOp, PatternRewriter &rewriter) const override { @@ -456,8 +454,7 @@ OpFoldResult TensorDynamicConstantOp::fold(FoldAdaptor operands) { namespace { -struct ExpandDynamicShapeConstant - : public OpRewritePattern { +struct ExpandDynamicShapeConstant : OpRewritePattern { using Base::Base; LogicalResult matchAndRewrite(TensorDynamicConstantOp op, PatternRewriter &rewriter) const override { @@ -532,7 +529,7 @@ namespace { // source. This prevents big useless chains and makes it easier to track the // original storage for the tensor. template -struct FlattenTensorCastLikeChain : public OpRewritePattern { +struct FlattenTensorCastLikeChain : OpRewritePattern { using OpRewritePattern::OpRewritePattern; LogicalResult matchAndRewrite(CastOpTy reshapeOp, PatternRewriter &rewriter) const override { @@ -572,7 +569,7 @@ struct FlattenTensorCastLikeChain : public OpRewritePattern { } }; -struct ResolveShapedRank : public OpRewritePattern { +struct ResolveShapedRank : OpRewritePattern { using Base::Base; LogicalResult matchAndRewrite(tensor::RankOp op, PatternRewriter &rewriter) const override { @@ -583,7 +580,7 @@ struct ResolveShapedRank : public OpRewritePattern { } }; -struct ResolveShapedDim : public OpRewritePattern { +struct ResolveShapedDim : OpRewritePattern { using Base::Base; LogicalResult matchAndRewrite(tensor::DimOp op, PatternRewriter &rewriter) const override { @@ -683,7 +680,7 @@ namespace { // Replace `flow.tensor.splat`-`flow.tensor.load` op-pairs by the input // primitive value for the splat op. -struct FoldSplatLoadIntoPrimitive : public OpRewritePattern { +struct FoldSplatLoadIntoPrimitive : OpRewritePattern { using Base::Base; LogicalResult matchAndRewrite(TensorLoadOp loadOp, PatternRewriter &rewriter) const override { @@ -757,7 +754,7 @@ void TensorEmptyOp::getCanonicalizationPatterns(RewritePatternSet &results, namespace { -struct FoldSplatReshapeIntoSplat : public OpRewritePattern { +struct FoldSplatReshapeIntoSplat : OpRewritePattern { using Base::Base; LogicalResult matchAndRewrite(TensorReshapeOp reshapeOp, PatternRewriter &rewriter) const override { @@ -882,7 +879,7 @@ namespace { // is transferred to the same context it's already on. This does not look across // control flow edges or globals and is mostly for simplifying IR that may come // in with a transfer on every single tensor. -struct ElideRedundantTransfer : public OpRewritePattern { +struct ElideRedundantTransfer : OpRewritePattern { using Base::Base; LogicalResult matchAndRewrite(TensorTransferOp op, PatternRewriter &rewriter) const override { @@ -1074,7 +1071,7 @@ namespace { // When the target tensor is a result of a tensor.cast operation, the op needs // to be updated to use the source of the cast as the target tensor. -struct FoldTensorUpdateOpWithCasts : public OpRewritePattern { +struct FoldTensorUpdateOpWithCasts : OpRewritePattern { using Base::Base; LogicalResult matchAndRewrite(TensorUpdateOp updateOp, PatternRewriter &rewriter) const override { @@ -1103,7 +1100,7 @@ struct FoldTensorUpdateOpWithCasts : public OpRewritePattern { }; struct ReplaceOpIfTensorUpdateOperandZeroElements - : public OpRewritePattern { + : OpRewritePattern { using Base::Base; LogicalResult matchAndRewrite(TensorUpdateOp op, PatternRewriter &rewriter) const override { diff --git a/compiler/src/iree/compiler/Dialect/Flow/IR/FlowOps.cpp b/compiler/src/iree/compiler/Dialect/Flow/IR/FlowOps.cpp index b657b6e55e82..8150fff78d68 100644 --- a/compiler/src/iree/compiler/Dialect/Flow/IR/FlowOps.cpp +++ b/compiler/src/iree/compiler/Dialect/Flow/IR/FlowOps.cpp @@ -685,8 +685,7 @@ bool dropUnusedAndRedundantDispatchRegionResults( return true; } -struct DispatchRegionDropUnusedResults - : public OpRewritePattern { +struct DispatchRegionDropUnusedResults : OpRewritePattern { using Base::Base; LogicalResult matchAndRewrite(DispatchRegionOp regionOp, diff --git a/compiler/src/iree/compiler/Dialect/Flow/Transforms/AnnotateDispatches.cpp b/compiler/src/iree/compiler/Dialect/Flow/Transforms/AnnotateDispatches.cpp index f0dfc6bc73b5..4aa456192e98 100644 --- a/compiler/src/iree/compiler/Dialect/Flow/Transforms/AnnotateDispatches.cpp +++ b/compiler/src/iree/compiler/Dialect/Flow/Transforms/AnnotateDispatches.cpp @@ -493,8 +493,7 @@ static std::string summarizeDispatchRegion(Region ®ion) { } struct AnnotateDispatchesPass - : public IREE::Flow::impl::AnnotateDispatchesPassBase< - AnnotateDispatchesPass> { + : IREE::Flow::impl::AnnotateDispatchesPassBase { void runOnOperation() override { DenseMap entryPointRefReplacements; diff --git a/compiler/src/iree/compiler/Dialect/Flow/Transforms/Canonicalize.cpp b/compiler/src/iree/compiler/Dialect/Flow/Transforms/Canonicalize.cpp index 9450fd50cb9e..eb526e0e85d9 100644 --- a/compiler/src/iree/compiler/Dialect/Flow/Transforms/Canonicalize.cpp +++ b/compiler/src/iree/compiler/Dialect/Flow/Transforms/Canonicalize.cpp @@ -34,7 +34,7 @@ static std::optional> getDefiningMixedSizes(Value v) { return {}; } -struct FoldFullInsertSlice : public OpRewritePattern { +struct FoldFullInsertSlice : OpRewritePattern { using Base::Base; LogicalResult matchAndRewrite(tensor::InsertSliceOp insertSliceOp, @@ -103,7 +103,7 @@ class AffineApplyLowering : public OpRewritePattern { }; /// Canonicalize operations in nested regions. -struct CanonicalizePass : public impl::CanonicalizePassBase { +struct CanonicalizePass : impl::CanonicalizePassBase { using IREE::Flow::impl::CanonicalizePassBase< CanonicalizePass>::CanonicalizePassBase; /// Initialize the canonicalizer by building the set of patterns used during diff --git a/compiler/src/iree/compiler/Dialect/Flow/Transforms/CaptureDynamicDims.cpp b/compiler/src/iree/compiler/Dialect/Flow/Transforms/CaptureDynamicDims.cpp index b53fe9e783a1..768bf774cb68 100644 --- a/compiler/src/iree/compiler/Dialect/Flow/Transforms/CaptureDynamicDims.cpp +++ b/compiler/src/iree/compiler/Dialect/Flow/Transforms/CaptureDynamicDims.cpp @@ -272,8 +272,7 @@ static void captureDims(scf::ForOp forOp) { } struct CaptureDynamicDimsPass - : public IREE::Flow::impl::CaptureDynamicDimsPassBase< - CaptureDynamicDimsPass> { + : IREE::Flow::impl::CaptureDynamicDimsPassBase { void runOnOperation() override { getOperation()->walk([&](scf::ForOp forOp) { captureDims(forOp); }); getOperation()->walk([&](IREE::Flow::DispatchWorkgroupsOp dispatchOp) { diff --git a/compiler/src/iree/compiler/Dialect/Flow/Transforms/CleanupTensorShapes.cpp b/compiler/src/iree/compiler/Dialect/Flow/Transforms/CleanupTensorShapes.cpp index 6b4d127ff8c7..4fec8f05eb6e 100644 --- a/compiler/src/iree/compiler/Dialect/Flow/Transforms/CleanupTensorShapes.cpp +++ b/compiler/src/iree/compiler/Dialect/Flow/Transforms/CleanupTensorShapes.cpp @@ -16,8 +16,7 @@ namespace mlir::iree_compiler::IREE::Flow { namespace { struct CleanupTensorShapesPass - : public IREE::Flow::impl::CleanupTensorShapesPassBase< - CleanupTensorShapesPass> { + : IREE::Flow::impl::CleanupTensorShapesPassBase { void runOnOperation() override { // Walk ops and ensure we no longer have any tensor shape queries. // If we come across any shape witness ops we can erase those. diff --git a/compiler/src/iree/compiler/Dialect/Flow/Transforms/ConvertToFlow.cpp b/compiler/src/iree/compiler/Dialect/Flow/Transforms/ConvertToFlow.cpp index b6484e45b177..6c10442b6f8d 100644 --- a/compiler/src/iree/compiler/Dialect/Flow/Transforms/ConvertToFlow.cpp +++ b/compiler/src/iree/compiler/Dialect/Flow/Transforms/ConvertToFlow.cpp @@ -22,7 +22,7 @@ namespace { // Pass to test conversion to flow patterns. struct ConvertToFlowPass - : public IREE::Flow::impl::ConvertToFlowPassBase { + : IREE::Flow::impl::ConvertToFlowPassBase { void runOnOperation() override { MLIRContext *context = &getContext(); RewritePatternSet convertToFlowPatterns(context); diff --git a/compiler/src/iree/compiler/Dialect/Flow/Transforms/ExportBenchmarkFuncs.cpp b/compiler/src/iree/compiler/Dialect/Flow/Transforms/ExportBenchmarkFuncs.cpp index 9c2644adf868..b690dd5afed4 100644 --- a/compiler/src/iree/compiler/Dialect/Flow/Transforms/ExportBenchmarkFuncs.cpp +++ b/compiler/src/iree/compiler/Dialect/Flow/Transforms/ExportBenchmarkFuncs.cpp @@ -274,8 +274,7 @@ createEntryPointBenchmarkFunc(mlir::ModuleOp moduleOp, // attribute from the old functions. // The input are provided using util.globals. struct ExportBenchmarkFuncsPass - : public IREE::Flow::impl::ExportBenchmarkFuncsPassBase< - ExportBenchmarkFuncsPass> { + : IREE::Flow::impl::ExportBenchmarkFuncsPassBase { void runOnOperation() override { mlir::ModuleOp moduleOp = getOperation(); diff --git a/compiler/src/iree/compiler/Dialect/Flow/Transforms/InitializeEmptyTensors.cpp b/compiler/src/iree/compiler/Dialect/Flow/Transforms/InitializeEmptyTensors.cpp index 3d802e50ee3b..bddd3edb9c7f 100644 --- a/compiler/src/iree/compiler/Dialect/Flow/Transforms/InitializeEmptyTensors.cpp +++ b/compiler/src/iree/compiler/Dialect/Flow/Transforms/InitializeEmptyTensors.cpp @@ -42,7 +42,7 @@ static bool shouldBeConvertedToFlowTensorOp(tensor::EmptyOp emptyTensorOp) { namespace { /// Converts an tensor.empty() op to `flow.tensor.splat` op. -struct RewriteTensorEmptyToSplat : public OpRewritePattern { +struct RewriteTensorEmptyToSplat : OpRewritePattern { using Base::Base; LogicalResult matchAndRewrite(tensor::EmptyOp emptyTensorOp, PatternRewriter &rewriter) const override { @@ -66,7 +66,7 @@ struct RewriteTensorEmptyToSplat : public OpRewritePattern { }; /// Converts an tensor.empty() op to `flow.tensor.empty` op. -struct RewriteTensorEmptyToEmpty : public OpRewritePattern { +struct RewriteTensorEmptyToEmpty : OpRewritePattern { using Base::Base; LogicalResult matchAndRewrite(tensor::EmptyOp emptyTensorOp, PatternRewriter &rewriter) const override { @@ -82,7 +82,7 @@ struct RewriteTensorEmptyToEmpty : public OpRewritePattern { /// Pass to invoke the pattern. struct InitializeEmptyTensorsPass - : public IREE::Flow::impl::InitializeEmptyTensorsPassBase< + : IREE::Flow::impl::InitializeEmptyTensorsPassBase< InitializeEmptyTensorsPass> { using IREE::Flow::impl::InitializeEmptyTensorsPassBase< InitializeEmptyTensorsPass>::InitializeEmptyTensorsPassBase; diff --git a/compiler/src/iree/compiler/Dialect/Flow/Transforms/InjectDispatchTracing.cpp b/compiler/src/iree/compiler/Dialect/Flow/Transforms/InjectDispatchTracing.cpp index 3f9044499c4a..82270618268c 100644 --- a/compiler/src/iree/compiler/Dialect/Flow/Transforms/InjectDispatchTracing.cpp +++ b/compiler/src/iree/compiler/Dialect/Flow/Transforms/InjectDispatchTracing.cpp @@ -69,7 +69,7 @@ getInRowMajorLayout(OpBuilder &builder, SmallVector tensorValues, namespace { struct InjectDispatchTracingPass - : public IREE::Flow::impl::InjectDispatchTracingPassBase< + : IREE::Flow::impl::InjectDispatchTracingPassBase< InjectDispatchTracingPass> { void runOnOperation() override { mlir::FunctionOpInterface funcOp = getOperation(); diff --git a/compiler/src/iree/compiler/Dialect/Flow/Transforms/InjectTensorTracing.cpp b/compiler/src/iree/compiler/Dialect/Flow/Transforms/InjectTensorTracing.cpp index 9e656b43ee32..e78c778ad2bd 100644 --- a/compiler/src/iree/compiler/Dialect/Flow/Transforms/InjectTensorTracing.cpp +++ b/compiler/src/iree/compiler/Dialect/Flow/Transforms/InjectTensorTracing.cpp @@ -68,8 +68,7 @@ static void injectTracingOnOp(Operation *op, StringRef traceKey) { } struct InjectTensorTracingPass - : public IREE::Flow::impl::InjectTensorTracingPassBase< - InjectTensorTracingPass> { + : IREE::Flow::impl::InjectTensorTracingPassBase { void runOnOperation() override { auto attrName = StringAttr::get(&getContext(), "iree.tensor.trace"); mlir::FunctionOpInterface funcOp = getOperation(); diff --git a/compiler/src/iree/compiler/Dialect/Flow/Transforms/InsertDispatchDebugTargets.cpp b/compiler/src/iree/compiler/Dialect/Flow/Transforms/InsertDispatchDebugTargets.cpp index eb8ed0cf6fce..f69d2ea227f0 100644 --- a/compiler/src/iree/compiler/Dialect/Flow/Transforms/InsertDispatchDebugTargets.cpp +++ b/compiler/src/iree/compiler/Dialect/Flow/Transforms/InsertDispatchDebugTargets.cpp @@ -140,7 +140,7 @@ namespace { // Insert break/tracing by ordinal for the specified function. struct InsertDebugTargetAtOrdinalPass - : public IREE::Flow::impl::InsertDebugTargetAtOrdinalPassBase< + : IREE::Flow::impl::InsertDebugTargetAtOrdinalPassBase< InsertDebugTargetAtOrdinalPass> { using IREE::Flow::impl::InsertDebugTargetAtOrdinalPassBase< InsertDebugTargetAtOrdinalPass>::InsertDebugTargetAtOrdinalPassBase; @@ -215,7 +215,7 @@ struct InsertDebugTargetAtOrdinalPass // Break/trace by symbol, after outlining dispatch regions and // deduplication. struct InsertDebugTargetAtSymbolPass - : public IREE::Flow::impl::InsertDebugTargetAtSymbolPassBase< + : IREE::Flow::impl::InsertDebugTargetAtSymbolPassBase< InsertDebugTargetAtSymbolPass> { using IREE::Flow::impl::InsertDebugTargetAtSymbolPassBase< InsertDebugTargetAtSymbolPass>::InsertDebugTargetAtSymbolPassBase; diff --git a/compiler/src/iree/compiler/Dialect/Flow/Transforms/OutlineConstants.cpp b/compiler/src/iree/compiler/Dialect/Flow/Transforms/OutlineConstants.cpp index ca984231f5f6..7227821b6a8c 100644 --- a/compiler/src/iree/compiler/Dialect/Flow/Transforms/OutlineConstants.cpp +++ b/compiler/src/iree/compiler/Dialect/Flow/Transforms/OutlineConstants.cpp @@ -116,7 +116,7 @@ static std::string getConstantName(ConstantDef &def) { //===----------------------------------------------------------------------===// struct OutlineConstantsPass - : public IREE::Flow::impl::OutlineConstantsPassBase { + : IREE::Flow::impl::OutlineConstantsPassBase { void runOnOperation() override { mlir::ModuleOp moduleOp = getOperation(); if (moduleOp.getBody()->empty()) { diff --git a/compiler/src/iree/compiler/Dialect/Flow/Transforms/OutlineDispatchExterns.cpp b/compiler/src/iree/compiler/Dialect/Flow/Transforms/OutlineDispatchExterns.cpp index 8704dffef80c..fbeb86498eea 100644 --- a/compiler/src/iree/compiler/Dialect/Flow/Transforms/OutlineDispatchExterns.cpp +++ b/compiler/src/iree/compiler/Dialect/Flow/Transforms/OutlineDispatchExterns.cpp @@ -132,7 +132,7 @@ outlineDispatchExternOp(std::string name, } // namespace struct OutlineDispatchExternsPass - : public IREE::Flow::impl::OutlineDispatchExternsPassBase< + : IREE::Flow::impl::OutlineDispatchExternsPassBase< OutlineDispatchExternsPass> { void runOnOperation() override { SymbolTable moduleSymbolTable(getOperation()); diff --git a/compiler/src/iree/compiler/Dialect/Flow/Transforms/OutlineDispatchRegions.cpp b/compiler/src/iree/compiler/Dialect/Flow/Transforms/OutlineDispatchRegions.cpp index 98f8664a3660..8a07b17fa9d4 100644 --- a/compiler/src/iree/compiler/Dialect/Flow/Transforms/OutlineDispatchRegions.cpp +++ b/compiler/src/iree/compiler/Dialect/Flow/Transforms/OutlineDispatchRegions.cpp @@ -155,7 +155,7 @@ static LogicalResult outlineDispatchWorkgroupsOp( } struct OutlineDispatchRegionsPass - : public IREE::Flow::impl::OutlineDispatchRegionsPassBase< + : IREE::Flow::impl::OutlineDispatchRegionsPassBase< OutlineDispatchRegionsPass> { void runOnOperation() override { // Convert each dispatch region into a flow.executable + dispatch op. diff --git a/compiler/src/iree/compiler/Dialect/Flow/Transforms/Passes.h b/compiler/src/iree/compiler/Dialect/Flow/Transforms/Passes.h index 5334dd5d862e..50e855d0e8ae 100644 --- a/compiler/src/iree/compiler/Dialect/Flow/Transforms/Passes.h +++ b/compiler/src/iree/compiler/Dialect/Flow/Transforms/Passes.h @@ -24,7 +24,7 @@ namespace mlir::iree_compiler::IREE::Flow { /// This is a placeholder for future. We should pass all the options through the /// struct. -struct TransformOptions : public PassPipelineOptions {}; +struct TransformOptions : PassPipelineOptions {}; // Adds a set of passes to the given pass manager that run the required flow // transforms in the canonical order. diff --git a/compiler/src/iree/compiler/Dialect/Flow/Transforms/ReplicateGlobalsPerAffinity.cpp b/compiler/src/iree/compiler/Dialect/Flow/Transforms/ReplicateGlobalsPerAffinity.cpp index 76f91e7460cb..2742473d443d 100644 --- a/compiler/src/iree/compiler/Dialect/Flow/Transforms/ReplicateGlobalsPerAffinity.cpp +++ b/compiler/src/iree/compiler/Dialect/Flow/Transforms/ReplicateGlobalsPerAffinity.cpp @@ -336,7 +336,7 @@ class OpOperandAffinityStateMap { }; struct ReplicateGlobalsPerAffinityPass - : public impl::ReplicateGlobalsPerAffinityPassBase< + : impl::ReplicateGlobalsPerAffinityPassBase< ReplicateGlobalsPerAffinityPass> { using Base::Base; void runOnOperation() override; diff --git a/compiler/src/iree/compiler/Dialect/Flow/Transforms/TopLevelSCFToCFG.cpp b/compiler/src/iree/compiler/Dialect/Flow/Transforms/TopLevelSCFToCFG.cpp index ebb45e4be18a..99a2da31d413 100644 --- a/compiler/src/iree/compiler/Dialect/Flow/Transforms/TopLevelSCFToCFG.cpp +++ b/compiler/src/iree/compiler/Dialect/Flow/Transforms/TopLevelSCFToCFG.cpp @@ -21,7 +21,7 @@ namespace mlir::iree_compiler::IREE::Flow { namespace { struct TopLevelSCFToCFGPass - : public IREE::Flow::impl::TopLevelSCFToCFGPassBase { + : IREE::Flow::impl::TopLevelSCFToCFGPassBase { void runOnOperation() override; }; diff --git a/compiler/src/iree/compiler/Dialect/Flow/Transforms/VerifyInputLegality.cpp b/compiler/src/iree/compiler/Dialect/Flow/Transforms/VerifyInputLegality.cpp index b003aca898d8..2614f987125d 100644 --- a/compiler/src/iree/compiler/Dialect/Flow/Transforms/VerifyInputLegality.cpp +++ b/compiler/src/iree/compiler/Dialect/Flow/Transforms/VerifyInputLegality.cpp @@ -19,8 +19,7 @@ namespace mlir::iree_compiler::IREE::Flow { namespace { struct VerifyInputLegalityPass - : public IREE::Flow::impl::VerifyInputLegalityPassBase< - VerifyInputLegalityPass> { + : IREE::Flow::impl::VerifyInputLegalityPassBase { void runOnOperation() override { ConversionTarget target(getContext()); target.markUnknownOpDynamicallyLegal([](Operation *) { return true; }); diff --git a/compiler/src/iree/compiler/Dialect/HAL/Conversion/HALToHAL/Patterns.cpp b/compiler/src/iree/compiler/Dialect/HAL/Conversion/HALToHAL/Patterns.cpp index 985fee69991f..59b12a0af6d1 100644 --- a/compiler/src/iree/compiler/Dialect/HAL/Conversion/HALToHAL/Patterns.cpp +++ b/compiler/src/iree/compiler/Dialect/HAL/Conversion/HALToHAL/Patterns.cpp @@ -16,7 +16,7 @@ namespace mlir::iree_compiler { namespace { struct ConvertDeviceResolveAnyOp - : public OpConversionPattern { + : OpConversionPattern { using Base::Base; LogicalResult matchAndRewrite(IREE::HAL::DeviceResolveOp resolveOp, OpAdaptor adaptor, @@ -56,7 +56,7 @@ struct ConvertDeviceResolveAnyOp }; struct ConvertDeviceResolveAffinityOp - : public OpConversionPattern { + : OpConversionPattern { using Base::Base; LogicalResult matchAndRewrite(IREE::HAL::DeviceResolveOp resolveOp, OpAdaptor adaptor, @@ -102,7 +102,7 @@ struct ConvertDeviceResolveAffinityOp }; struct ConvertExecutableCalculateWorkgroupsOp - : public OpConversionPattern { + : OpConversionPattern { using Base::Base; LogicalResult matchAndRewrite(IREE::HAL::ExecutableCalculateWorkgroupsOp calculateOp, diff --git a/compiler/src/iree/compiler/Dialect/HAL/Conversion/HALToVM/ConvertBufferOps.cpp b/compiler/src/iree/compiler/Dialect/HAL/Conversion/HALToVM/ConvertBufferOps.cpp index 723a3b6c2900..39d90290e7c5 100644 --- a/compiler/src/iree/compiler/Dialect/HAL/Conversion/HALToVM/ConvertBufferOps.cpp +++ b/compiler/src/iree/compiler/Dialect/HAL/Conversion/HALToVM/ConvertBufferOps.cpp @@ -178,8 +178,7 @@ class BufferStoreOpConversion mutable IREE::VM::ImportOp importOp; }; -struct MemoryTypeOpConversion - : public OpConversionPattern { +struct MemoryTypeOpConversion : OpConversionPattern { using Base::Base; LogicalResult matchAndRewrite(IREE::HAL::MemoryTypeOp op, @@ -191,8 +190,7 @@ struct MemoryTypeOpConversion } }; -struct BufferUsageOpConversion - : public OpConversionPattern { +struct BufferUsageOpConversion : OpConversionPattern { using Base::Base; LogicalResult matchAndRewrite(IREE::HAL::BufferUsageOp op, diff --git a/compiler/src/iree/compiler/Dialect/HAL/Conversion/HALToVM/ConvertBufferViewOps.cpp b/compiler/src/iree/compiler/Dialect/HAL/Conversion/HALToVM/ConvertBufferViewOps.cpp index 35bf462c11bf..6689763af309 100644 --- a/compiler/src/iree/compiler/Dialect/HAL/Conversion/HALToVM/ConvertBufferViewOps.cpp +++ b/compiler/src/iree/compiler/Dialect/HAL/Conversion/HALToVM/ConvertBufferViewOps.cpp @@ -10,8 +10,7 @@ namespace mlir::iree_compiler { -struct ElementTypeOpConversion - : public OpConversionPattern { +struct ElementTypeOpConversion : OpConversionPattern { using Base::Base; LogicalResult matchAndRewrite(IREE::HAL::ElementTypeOp op, OpAdaptor adaptor, @@ -28,7 +27,7 @@ struct ElementTypeOpConversion }; struct EncodingTypeOpConversion - : public OpConversionPattern { + : OpConversionPattern { using Base::Base; LogicalResult matchAndRewrite(IREE::HAL::EncodingTypeOp op, OpAdaptor adaptor, diff --git a/compiler/src/iree/compiler/Dialect/HAL/Conversion/StandardToHAL/ConvertShapeOps.cpp b/compiler/src/iree/compiler/Dialect/HAL/Conversion/StandardToHAL/ConvertShapeOps.cpp index 45aab75f9da3..e01ab011a9cb 100644 --- a/compiler/src/iree/compiler/Dialect/HAL/Conversion/StandardToHAL/ConvertShapeOps.cpp +++ b/compiler/src/iree/compiler/Dialect/HAL/Conversion/StandardToHAL/ConvertShapeOps.cpp @@ -16,7 +16,7 @@ namespace mlir::iree_compiler { namespace { -struct BufferViewDimPattern : public OpConversionPattern { +struct BufferViewDimPattern : OpConversionPattern { using Base::Base; LogicalResult matchAndRewrite(tensor::DimOp dimOp, OpAdaptor adaptor, @@ -33,7 +33,7 @@ struct BufferViewDimPattern : public OpConversionPattern { } }; -struct BufferViewRankPattern : public OpConversionPattern { +struct BufferViewRankPattern : OpConversionPattern { using Base::Base; LogicalResult matchAndRewrite(tensor::RankOp rankOp, OpAdaptor adaptor, diff --git a/compiler/src/iree/compiler/Dialect/HAL/Conversion/StreamToHAL/Patterns.cpp b/compiler/src/iree/compiler/Dialect/HAL/Conversion/StreamToHAL/Patterns.cpp index 4857b148193a..2f33f74b34a1 100644 --- a/compiler/src/iree/compiler/Dialect/HAL/Conversion/StreamToHAL/Patterns.cpp +++ b/compiler/src/iree/compiler/Dialect/HAL/Conversion/StreamToHAL/Patterns.cpp @@ -40,7 +40,7 @@ static llvm::cl::opt clForceIndirectCommandBuffers{ }; struct ContextResolveOpPattern - : public StreamConversionPattern { + : StreamConversionPattern { using StreamConversionPattern::StreamConversionPattern; LogicalResult matchAndRewrite(IREE::Stream::ContextResolveOp resolveOp, OpAdaptor adaptor, @@ -89,7 +89,7 @@ struct ContextResolveOpPattern }; struct ResourceAllocOpPattern - : public StreamConversionPattern { + : StreamConversionPattern { using StreamConversionPattern::StreamConversionPattern; LogicalResult matchAndRewrite(IREE::Stream::ResourceAllocOp allocOp, OpAdaptor adaptor, @@ -118,7 +118,7 @@ struct ResourceAllocOpPattern }; struct ResourceAllocaOpPattern - : public StreamConversionPattern { + : StreamConversionPattern { using StreamConversionPattern::StreamConversionPattern; LogicalResult matchAndRewrite(IREE::Stream::ResourceAllocaOp allocaOp, OpAdaptor adaptor, @@ -166,7 +166,7 @@ struct ResourceAllocaOpPattern }; struct ResourceDeallocaOpPattern - : public StreamConversionPattern { + : StreamConversionPattern { using StreamConversionPattern::StreamConversionPattern; LogicalResult matchAndRewrite(IREE::Stream::ResourceDeallocaOp deallocaOp, @@ -214,7 +214,7 @@ struct ResourceDeallocaOpPattern }; struct ResourceRetainOpPattern - : public StreamConversionPattern { + : StreamConversionPattern { using StreamConversionPattern::StreamConversionPattern; LogicalResult matchAndRewrite(IREE::Stream::ResourceRetainOp op, OpAdaptor adaptor, @@ -226,7 +226,7 @@ struct ResourceRetainOpPattern }; struct ResourceReleaseOpPattern - : public StreamConversionPattern { + : StreamConversionPattern { using StreamConversionPattern::StreamConversionPattern; LogicalResult matchAndRewrite(IREE::Stream::ResourceReleaseOp op, OpAdaptor adaptor, @@ -238,7 +238,7 @@ struct ResourceReleaseOpPattern }; struct ResourceIsTerminalOpPattern - : public StreamConversionPattern { + : StreamConversionPattern { using StreamConversionPattern::StreamConversionPattern; LogicalResult matchAndRewrite(IREE::Stream::ResourceIsTerminalOp op, OpAdaptor adaptor, @@ -250,7 +250,7 @@ struct ResourceIsTerminalOpPattern }; struct ResourceSizeOpPattern - : public StreamConversionPattern { + : StreamConversionPattern { using StreamConversionPattern::StreamConversionPattern; LogicalResult matchAndRewrite(IREE::Stream::ResourceSizeOp sizeOp, OpAdaptor adaptor, @@ -262,7 +262,7 @@ struct ResourceSizeOpPattern }; struct ResourceTryMapOpPattern - : public StreamConversionPattern { + : StreamConversionPattern { using StreamConversionPattern::StreamConversionPattern; LogicalResult matchAndRewrite(IREE::Stream::ResourceTryMapOp tryMapOp, OpAdaptor adaptor, @@ -323,7 +323,7 @@ struct ResourceTryMapOpPattern }; struct ResourceLoadOpPattern - : public StreamConversionPattern { + : StreamConversionPattern { using StreamConversionPattern::StreamConversionPattern; LogicalResult matchAndRewrite(IREE::Stream::ResourceLoadOp loadOp, OpAdaptor adaptor, @@ -337,7 +337,7 @@ struct ResourceLoadOpPattern }; struct ResourceStoreOpPattern - : public StreamConversionPattern { + : StreamConversionPattern { using StreamConversionPattern::StreamConversionPattern; LogicalResult matchAndRewrite(IREE::Stream::ResourceStoreOp storeOp, OpAdaptor adaptor, @@ -350,7 +350,7 @@ struct ResourceStoreOpPattern }; struct ResourceSubviewOpPattern - : public StreamConversionPattern { + : StreamConversionPattern { using StreamConversionPattern::StreamConversionPattern; LogicalResult matchAndRewrite(IREE::Stream::ResourceSubviewOp subviewOp, OpAdaptor adaptor, @@ -366,7 +366,7 @@ struct ResourceSubviewOpPattern }; struct FileConstantOpPattern - : public StreamConversionPattern { + : StreamConversionPattern { using StreamConversionPattern::StreamConversionPattern; LogicalResult matchAndRewrite(IREE::Stream::FileConstantOp constantOp, OpAdaptor adaptor, @@ -383,8 +383,7 @@ struct FileConstantOpPattern } }; -struct FileReadOpPattern - : public StreamConversionPattern { +struct FileReadOpPattern : StreamConversionPattern { using StreamConversionPattern::StreamConversionPattern; LogicalResult matchAndRewrite(IREE::Stream::FileReadOp readOp, OpAdaptor adaptor, @@ -412,8 +411,7 @@ struct FileReadOpPattern } }; -struct FileWriteOpPattern - : public StreamConversionPattern { +struct FileWriteOpPattern : StreamConversionPattern { using StreamConversionPattern::StreamConversionPattern; LogicalResult matchAndRewrite(IREE::Stream::FileWriteOp writeOp, OpAdaptor adaptor, @@ -471,7 +469,7 @@ buildStorageAssertions(Location loc, Value buffer, StringAttr message, } struct TensorImportBufferOpPattern - : public StreamConversionPattern { + : StreamConversionPattern { using StreamConversionPattern::StreamConversionPattern; LogicalResult matchAndRewrite(IREE::Stream::TensorImportOp importOp, OpAdaptor adaptor, @@ -502,7 +500,7 @@ struct TensorImportBufferOpPattern }; struct TensorImportBufferViewOpPattern - : public StreamConversionPattern { + : StreamConversionPattern { using StreamConversionPattern::StreamConversionPattern; LogicalResult matchAndRewrite(IREE::Stream::TensorImportOp importOp, OpAdaptor adaptor, @@ -538,7 +536,7 @@ struct TensorImportBufferViewOpPattern }; struct TensorExportBufferOpPattern - : public StreamConversionPattern { + : StreamConversionPattern { using StreamConversionPattern::StreamConversionPattern; LogicalResult matchAndRewrite(IREE::Stream::TensorExportOp exportOp, OpAdaptor adaptor, @@ -552,7 +550,7 @@ struct TensorExportBufferOpPattern }; struct TensorExportBufferViewOpPattern - : public StreamConversionPattern { + : StreamConversionPattern { using StreamConversionPattern::StreamConversionPattern; LogicalResult matchAndRewrite(IREE::Stream::TensorExportOp exportOp, OpAdaptor adaptor, @@ -595,7 +593,7 @@ struct TensorExportBufferViewOpPattern }; struct TensorTraceOpPattern - : public StreamConversionPattern { + : StreamConversionPattern { using StreamConversionPattern::StreamConversionPattern; LogicalResult matchAndRewrite(IREE::Stream::TensorTraceOp traceOp, OpAdaptor adaptor, @@ -621,8 +619,7 @@ struct TensorTraceOpPattern } }; -struct CmdFlushOpPattern - : public StreamConversionPattern { +struct CmdFlushOpPattern : StreamConversionPattern { using StreamConversionPattern::StreamConversionPattern; LogicalResult matchAndRewrite(IREE::Stream::CmdFlushOp op, OpAdaptor adaptor, @@ -634,7 +631,7 @@ struct CmdFlushOpPattern }; struct CmdInvalidateOpPattern - : public StreamConversionPattern { + : StreamConversionPattern { using StreamConversionPattern::StreamConversionPattern; LogicalResult matchAndRewrite(IREE::Stream::CmdInvalidateOp op, OpAdaptor adaptor, @@ -646,7 +643,7 @@ struct CmdInvalidateOpPattern }; struct CmdDiscardOpPattern - : public StreamConversionPattern { + : StreamConversionPattern { using StreamConversionPattern::StreamConversionPattern; LogicalResult matchAndRewrite(IREE::Stream::CmdDiscardOp op, OpAdaptor adaptor, @@ -657,8 +654,7 @@ struct CmdDiscardOpPattern } }; -struct CmdFillOpPattern - : public StreamConversionPattern { +struct CmdFillOpPattern : StreamConversionPattern { using StreamConversionPattern::StreamConversionPattern; LogicalResult matchAndRewrite(IREE::Stream::CmdFillOp fillOp, OpAdaptor adaptor, @@ -675,8 +671,7 @@ struct CmdFillOpPattern } }; -struct CmdCopyOpPattern - : public StreamConversionPattern { +struct CmdCopyOpPattern : StreamConversionPattern { using StreamConversionPattern::StreamConversionPattern; LogicalResult matchAndRewrite(IREE::Stream::CmdCopyOp op, OpAdaptor adaptor, @@ -717,7 +712,7 @@ convertCollectiveAttr(IREE::Stream::CollectiveAttr sourceAttr) { } struct CmdCollectiveOpPattern - : public StreamConversionPattern { + : StreamConversionPattern { using StreamConversionPattern::StreamConversionPattern; LogicalResult matchAndRewrite(IREE::Stream::CmdCollectiveOp op, OpAdaptor adaptor, @@ -765,7 +760,7 @@ struct CmdCollectiveOpPattern }; struct CmdDispatchOpPattern - : public StreamConversionPattern { + : StreamConversionPattern { using StreamConversionPattern::StreamConversionPattern; LogicalResult matchAndRewrite(IREE::Stream::CmdDispatchOp dispatchOp, OpAdaptor adaptor, @@ -1023,8 +1018,7 @@ struct CmdDispatchOpPattern } }; -struct CmdFuncOpPattern - : public StreamConversionPattern { +struct CmdFuncOpPattern : StreamConversionPattern { using StreamConversionPattern::StreamConversionPattern; LogicalResult matchAndRewrite(IREE::Stream::CmdFuncOp funcOp, OpAdaptor adaptor, @@ -1073,8 +1067,7 @@ struct CmdFuncOpPattern } }; -struct CmdCallOpPattern - : public StreamConversionPattern { +struct CmdCallOpPattern : StreamConversionPattern { using StreamConversionPattern::StreamConversionPattern; LogicalResult matchAndRewrite(IREE::Stream::CmdCallOp callOp, OpAdaptor adaptor, @@ -1259,7 +1252,7 @@ static Operation *matchSingleTransferOp(IREE::Stream::CmdExecuteOp executeOp) { } struct CmdExecuteOpPattern - : public StreamConversionPattern { + : StreamConversionPattern { using StreamConversionPattern::StreamConversionPattern; LogicalResult matchAndRewrite(IREE::Stream::CmdExecuteOp executeOp, OpAdaptor adaptor, @@ -1432,8 +1425,7 @@ struct CmdExecuteOpPattern } }; -struct CmdSerialOpPattern - : public StreamConversionPattern { +struct CmdSerialOpPattern : StreamConversionPattern { using StreamConversionPattern::StreamConversionPattern; LogicalResult matchAndRewrite(IREE::Stream::CmdSerialOp serialOp, OpAdaptor adaptor, @@ -1455,7 +1447,7 @@ struct CmdSerialOpPattern }; struct CmdConcurrentOpPattern - : public StreamConversionPattern { + : StreamConversionPattern { using StreamConversionPattern::StreamConversionPattern; LogicalResult matchAndRewrite(IREE::Stream::CmdConcurrentOp concurrentOp, OpAdaptor adaptor, @@ -1469,7 +1461,7 @@ struct CmdConcurrentOpPattern }; struct TimepointImmediateOpPattern - : public StreamConversionPattern { + : StreamConversionPattern { using StreamConversionPattern::StreamConversionPattern; LogicalResult matchAndRewrite(IREE::Stream::TimepointImmediateOp immediateOp, @@ -1482,7 +1474,7 @@ struct TimepointImmediateOpPattern }; struct TimepointImportOpPattern - : public StreamConversionPattern { + : StreamConversionPattern { using StreamConversionPattern::StreamConversionPattern; LogicalResult matchAndRewrite(IREE::Stream::TimepointImportOp importOp, OpAdaptor adaptor, @@ -1501,7 +1493,7 @@ struct TimepointImportOpPattern }; struct TimepointExportOpPattern - : public StreamConversionPattern { + : StreamConversionPattern { using StreamConversionPattern::StreamConversionPattern; LogicalResult matchAndRewrite(IREE::Stream::TimepointExportOp exportOp, OpAdaptor adaptor, @@ -1518,7 +1510,7 @@ struct TimepointExportOpPattern }; struct TimepointChainExternalOpPattern - : public StreamConversionPattern { + : StreamConversionPattern { using StreamConversionPattern::StreamConversionPattern; LogicalResult matchAndRewrite(IREE::Stream::TimepointChainExternalOp exportOp, @@ -1543,7 +1535,7 @@ struct TimepointChainExternalOpPattern }; struct TimepointJoinOpPattern - : public StreamConversionPattern { + : StreamConversionPattern { using StreamConversionPattern::StreamConversionPattern; LogicalResult matchAndRewrite(IREE::Stream::TimepointJoinOp joinOp, OpAdaptor adaptor, @@ -1556,7 +1548,7 @@ struct TimepointJoinOpPattern }; struct TimepointBarrierOpPattern - : public StreamConversionPattern { + : StreamConversionPattern { using StreamConversionPattern::StreamConversionPattern; LogicalResult matchAndRewrite(IREE::Stream::TimepointBarrierOp barrierOp, OpAdaptor adaptor, @@ -1573,7 +1565,7 @@ struct TimepointBarrierOpPattern }; struct TimepointAwaitOpPattern - : public StreamConversionPattern { + : StreamConversionPattern { using StreamConversionPattern::StreamConversionPattern; LogicalResult matchAndRewrite(IREE::Stream::TimepointAwaitOp awaitOp, OpAdaptor adaptor, @@ -1595,7 +1587,7 @@ struct TimepointAwaitOpPattern }; struct ChannelCreateOpPattern - : public StreamConversionPattern { + : StreamConversionPattern { using StreamConversionPattern::StreamConversionPattern; LogicalResult matchAndRewrite(IREE::Stream::ChannelCreateOp createOp, OpAdaptor adaptor, @@ -1646,7 +1638,7 @@ struct ChannelCreateOpPattern }; struct ChannelSplitOpPattern - : public StreamConversionPattern { + : StreamConversionPattern { using StreamConversionPattern::StreamConversionPattern; LogicalResult matchAndRewrite(IREE::Stream::ChannelSplitOp splitOp, OpAdaptor adaptor, @@ -1663,7 +1655,7 @@ struct ChannelSplitOpPattern }; struct ChannelRankOpPattern - : public StreamConversionPattern { + : StreamConversionPattern { using StreamConversionPattern::StreamConversionPattern; LogicalResult matchAndRewrite(IREE::Stream::ChannelRankOp rankOp, OpAdaptor adaptor, @@ -1679,7 +1671,7 @@ struct ChannelRankOpPattern }; struct ChannelCountOpPattern - : public StreamConversionPattern { + : StreamConversionPattern { using StreamConversionPattern::StreamConversionPattern; LogicalResult matchAndRewrite(IREE::Stream::ChannelCountOp countOp, OpAdaptor adaptor, @@ -1694,8 +1686,7 @@ struct ChannelCountOpPattern } }; -struct ElideYieldOpPattern - : public StreamConversionPattern { +struct ElideYieldOpPattern : StreamConversionPattern { using StreamConversionPattern::StreamConversionPattern; LogicalResult matchAndRewrite(IREE::Stream::YieldOp yieldOp, OpAdaptor adaptor, @@ -1708,7 +1699,7 @@ struct ElideYieldOpPattern // Annoying we have to have this here, but there's no attribute converter // equivalent we have access to so that we could do it in a generic way. struct GlobalTimepointConversionPattern - : public OpConversionPattern { + : OpConversionPattern { using Base::Base; LogicalResult matchAndRewrite(IREE::Util::GlobalOp op, OpAdaptor adaptor, diff --git a/compiler/src/iree/compiler/Dialect/HAL/Conversion/StreamToHAL/Utils.h b/compiler/src/iree/compiler/Dialect/HAL/Conversion/StreamToHAL/Utils.h index b7e322dd9637..c3bcc4d7a8a3 100644 --- a/compiler/src/iree/compiler/Dialect/HAL/Conversion/StreamToHAL/Utils.h +++ b/compiler/src/iree/compiler/Dialect/HAL/Conversion/StreamToHAL/Utils.h @@ -135,7 +135,7 @@ class StreamConversionMapping { }; template -struct StreamConversionPattern : public OpConversionPattern { +struct StreamConversionPattern : OpConversionPattern { StreamConversionPattern(std::shared_ptr mapping, TypeConverter &typeConverter, MLIRContext *context, PatternBenefit benefit = 1) diff --git a/compiler/src/iree/compiler/Dialect/HAL/Conversion/UtilToHAL/Patterns.cpp b/compiler/src/iree/compiler/Dialect/HAL/Conversion/UtilToHAL/Patterns.cpp index b5f633c5f4ca..d63e04af502d 100644 --- a/compiler/src/iree/compiler/Dialect/HAL/Conversion/UtilToHAL/Patterns.cpp +++ b/compiler/src/iree/compiler/Dialect/HAL/Conversion/UtilToHAL/Patterns.cpp @@ -17,8 +17,7 @@ namespace mlir::iree_compiler { namespace { -struct GlobalConversionPattern - : public OpConversionPattern { +struct GlobalConversionPattern : OpConversionPattern { using Base::Base; LogicalResult matchAndRewrite(IREE::Util::GlobalOp op, OpAdaptor adaptor, diff --git a/compiler/src/iree/compiler/Dialect/HAL/IR/HALDialect.cpp b/compiler/src/iree/compiler/Dialect/HAL/IR/HALDialect.cpp index ea1fcdb969cf..70e5611fd747 100644 --- a/compiler/src/iree/compiler/Dialect/HAL/IR/HALDialect.cpp +++ b/compiler/src/iree/compiler/Dialect/HAL/IR/HALDialect.cpp @@ -29,7 +29,7 @@ namespace mlir::iree_compiler::IREE::HAL { namespace { // Used for custom printing support. -struct HALOpAsmInterface : public OpAsmDialectInterface { +struct HALOpAsmInterface : OpAsmDialectInterface { using OpAsmDialectInterface::OpAsmDialectInterface; /// Hooks for getting an alias identifier alias for a given symbol, that is /// not necessarily a part of this dialect. The identifier is used in place of @@ -52,7 +52,7 @@ struct HALOpAsmInterface : public OpAsmDialectInterface { }; // Used to control inlining behavior. -struct HALInlinerInterface : public DialectInlinerInterface { +struct HALInlinerInterface : DialectInlinerInterface { using DialectInlinerInterface::DialectInlinerInterface; bool isLegalToInline(Operation *call, Operation *callable, diff --git a/compiler/src/iree/compiler/Dialect/HAL/IR/HALOpFolders.cpp b/compiler/src/iree/compiler/Dialect/HAL/IR/HALOpFolders.cpp index a03d8ca44067..136b3e509153 100644 --- a/compiler/src/iree/compiler/Dialect/HAL/IR/HALOpFolders.cpp +++ b/compiler/src/iree/compiler/Dialect/HAL/IR/HALOpFolders.cpp @@ -29,7 +29,7 @@ namespace { // This is to support ops that are "pure" but can't be marked as such because // the MLIR CSE pass would deduplicate them. template -struct ElideUnusedOp : public OpRewritePattern { +struct ElideUnusedOp : OpRewritePattern { explicit ElideUnusedOp(MLIRContext *context) : OpRewritePattern(context, /*benefit=*/1000) {} LogicalResult matchAndRewrite(Op op, @@ -79,8 +79,7 @@ namespace { // %2 = hal.tensor.transients %1 : tensor{%dim} from %storage2 // => // %2 = hal.tensor.transients %0 : tensor{%dim} from %storage2 -struct FoldConsecutiveTransientsOps - : public OpRewritePattern { +struct FoldConsecutiveTransientsOps : OpRewritePattern { using OpRewritePattern::OpRewritePattern; LogicalResult matchAndRewrite(TensorTransientsOp op, PatternRewriter &rewriter) const override { @@ -114,8 +113,7 @@ void TensorTransientsOp::getCanonicalizationPatterns(RewritePatternSet &results, namespace { /// Deduplicates hal.tensor.barrier operands. -struct DeduplicateTensorBarrierSources - : public OpRewritePattern { +struct DeduplicateTensorBarrierSources : OpRewritePattern { using Base::Base; LogicalResult matchAndRewrite(TensorBarrierOp op, PatternRewriter &rewriter) const override { @@ -160,7 +158,7 @@ namespace { /// Tries to fold either the device or queue affinity of a select when all /// potential values of either match. -struct FoldAllocatorSelect : public OpRewritePattern { +struct FoldAllocatorSelect : OpRewritePattern { using Base::Base; LogicalResult matchAndRewrite(AllocatorSelectOp op, PatternRewriter &rewriter) const override { @@ -212,8 +210,7 @@ void AllocatorSelectOp::getCanonicalizationPatterns(RewritePatternSet &results, namespace { /// Folds hal.buffer.subspans into buffer view creation subspans. -struct FoldBufferViewCreateSubspan - : public OpRewritePattern { +struct FoldBufferViewCreateSubspan : OpRewritePattern { using Base::Base; LogicalResult matchAndRewrite(BufferViewCreateOp op, PatternRewriter &rewriter) const override { @@ -275,8 +272,7 @@ namespace { /// Skips a hal.command_buffer.device accessor when the device was created in /// the same scope. -struct SkipCommandBufferDeviceOp - : public OpRewritePattern { +struct SkipCommandBufferDeviceOp : OpRewritePattern { using Base::Base; LogicalResult matchAndRewrite(CommandBufferDeviceOp op, @@ -301,7 +297,7 @@ namespace { /// Folds hal.buffer.subspans into buffer fill offsets. struct FoldCommandBufferFillBufferSubspans - : public OpRewritePattern { + : OpRewritePattern { using Base::Base; LogicalResult matchAndRewrite(CommandBufferFillBufferOp op, @@ -342,7 +338,7 @@ namespace { /// Folds hal.buffer.subspans into buffer update offsets. struct FoldCommandBufferUpdateBufferSubspans - : public OpRewritePattern { + : OpRewritePattern { using Base::Base; LogicalResult matchAndRewrite(CommandBufferUpdateBufferOp op, @@ -383,7 +379,7 @@ namespace { /// Folds hal.buffer.subspans into buffer copy offsets. struct FoldCommandBufferCopyBufferSubspans - : public OpRewritePattern { + : OpRewritePattern { using Base::Base; LogicalResult matchAndRewrite(CommandBufferCopyBufferOp op, @@ -437,7 +433,7 @@ namespace { /// Folds hal.buffer.subspans into dispatch bindings. /// The binding range is always equal to or a subset of the subspan. template -struct FoldCommandBufferDispatchBufferSubspan : public OpRewritePattern { +struct FoldCommandBufferDispatchBufferSubspan : OpRewritePattern { using OpRewritePattern::OpRewritePattern; LogicalResult matchAndRewrite(OpT op, @@ -489,7 +485,7 @@ namespace { /// Folds hal.buffer.subspans into the indirect dispatch workgroup count. /// The binding range is always equal to or a subset of the subspan. struct FoldCommandBufferDispatchIndirectBufferSubspan - : public OpRewritePattern { + : OpRewritePattern { using Base::Base; LogicalResult matchAndRewrite(CommandBufferDispatchIndirectOp op, @@ -580,7 +576,7 @@ namespace { /// Swaps a device queue barrier with an immediate host fence signal when the /// wait fence is immediately resolved (null). struct ImmediatelyResolveDeviceQueueBarrier - : public OpRewritePattern { + : OpRewritePattern { using Base::Base; LogicalResult matchAndRewrite(DeviceQueueBarrierOp barrierOp, PatternRewriter &rewriter) const override { @@ -608,8 +604,7 @@ struct ImmediatelyResolveDeviceQueueBarrier /// hal.device.queue.execute wait(%fence0) signal(%fence1) /// -> /// hal.device.queue.barrier signal(%fence1) -struct HoistDeviceQueueBarrierChain - : public OpRewritePattern { +struct HoistDeviceQueueBarrierChain : OpRewritePattern { using Base::Base; LogicalResult matchAndRewrite(DeviceQueueBarrierOp barrierOp, PatternRewriter &rewriter) const override { @@ -665,8 +660,7 @@ struct HoistDeviceQueueBarrierChain /// hal.device.queue.barrier wait(%b) signal(%c) /// -> /// hal.device.queue.execute wait(%a) signal(%c) commands(...) -struct ElideDeviceQueueBarrierOp - : public OpRewritePattern { +struct ElideDeviceQueueBarrierOp : OpRewritePattern { using Base::Base; LogicalResult matchAndRewrite(DeviceQueueBarrierOp barrierOp, PatternRewriter &rewriter) const override { @@ -762,7 +756,7 @@ namespace { /// Removes the condition region and fallback from an export that will always be /// selected. This happens if the condition region is folded using a specialized /// target environment that allows for compile-time query evaluation. -struct DropTrueConditionRegion : public OpRewritePattern { +struct DropTrueConditionRegion : OpRewritePattern { using Base::Base; LogicalResult matchAndRewrite(ExecutableExportOp exportOp, PatternRewriter &rewriter) const override { @@ -852,8 +846,7 @@ static void rewriteToOneReturn(int numResults, Region ®ion, /// Merges hal.executable.constant.block ops together into one. /// Duplicate keys are ignored and will be cleaned up by /// DeduplicateExecutableConstantBlockKeys. -struct MergeExecutableConstantBlocks - : public OpRewritePattern { +struct MergeExecutableConstantBlocks : OpRewritePattern { using Base::Base; LogicalResult matchAndRewrite(ExecutableVariantOp variantOp, PatternRewriter &rewriter) const override { @@ -991,7 +984,7 @@ static void filterReturnOperands(ExecutableConstantBlockOp blockOp, /// Drops the %device argument of a constant block region if unused. struct DropUnusedExecutableConstantBlockDeviceArg - : public OpRewritePattern { + : OpRewritePattern { using Base::Base; LogicalResult matchAndRewrite(ExecutableConstantBlockOp blockOp, PatternRewriter &rewriter) const override { @@ -1016,7 +1009,7 @@ struct DropUnusedExecutableConstantBlockDeviceArg /// one found. There's no verification that the values produced are the same /// as users are expected to uniquely name their keys. struct DeduplicateExecutableConstantBlockKeys - : public OpRewritePattern { + : OpRewritePattern { using Base::Base; LogicalResult matchAndRewrite(ExecutableConstantBlockOp blockOp, PatternRewriter &rewriter) const override { @@ -1083,7 +1076,7 @@ OpFoldResult FenceJoinOp::fold(FoldAdaptor operands) { namespace { /// Replaces a fence join with no operands with a null value. -struct ElideEmptyFenceJoin : public OpRewritePattern { +struct ElideEmptyFenceJoin : OpRewritePattern { using Base::Base; LogicalResult matchAndRewrite(FenceJoinOp op, PatternRewriter &rewriter) const override { @@ -1117,7 +1110,7 @@ deduplicateFenceOperands(ValueRange operands) { } /// Deduplicates fence join operands and drops nulls. -struct DeduplicateFenceJoinFences : public OpRewritePattern { +struct DeduplicateFenceJoinFences : OpRewritePattern { using Base::Base; LogicalResult matchAndRewrite(FenceJoinOp op, PatternRewriter &rewriter) const override { @@ -1157,7 +1150,7 @@ namespace { /// hal.fence.signal<%fence : !hal.fence> /// -> /// %fence = util.null : !hal.fence -struct ElideSignaledFence : public OpRewritePattern { +struct ElideSignaledFence : OpRewritePattern { using Base::Base; LogicalResult matchAndRewrite(FenceSignalOp signalOp, PatternRewriter &rewriter) const override { @@ -1212,7 +1205,7 @@ void FenceSignalOp::getCanonicalizationPatterns(RewritePatternSet &results, namespace { /// Elides a fence await with no fences. -struct ElideEmptyFenceAwait : public OpRewritePattern { +struct ElideEmptyFenceAwait : OpRewritePattern { using Base::Base; LogicalResult matchAndRewrite(FenceAwaitOp op, PatternRewriter &rewriter) const override { @@ -1225,7 +1218,7 @@ struct ElideEmptyFenceAwait : public OpRewritePattern { }; /// Deduplicates fence await operands and drops nulls. -struct DeduplicateFenceAwaitFences : public OpRewritePattern { +struct DeduplicateFenceAwaitFences : OpRewritePattern { using Base::Base; LogicalResult matchAndRewrite(FenceAwaitOp op, PatternRewriter &rewriter) const override { diff --git a/compiler/src/iree/compiler/Dialect/HAL/IR/HALTypes.h b/compiler/src/iree/compiler/Dialect/HAL/IR/HALTypes.h index 019d04a8d04a..27215d58d243 100644 --- a/compiler/src/iree/compiler/Dialect/HAL/IR/HALTypes.h +++ b/compiler/src/iree/compiler/Dialect/HAL/IR/HALTypes.h @@ -70,16 +70,15 @@ std::optional lookupOffsetOrAlignment(Value value); // Object types //===----------------------------------------------------------------------===// -struct AllocatorType : public Type::TypeBase { +struct AllocatorType : Type::TypeBase { using Base::Base; static constexpr StringLiteral name = "hal.allocator"; }; -struct BufferType - : public Type::TypeBase { +struct BufferType : Type::TypeBase { using Base::Base; static constexpr StringLiteral name = "hal.buffer"; @@ -88,9 +87,9 @@ struct BufferType }; struct BufferViewType - : public Type::TypeBase { + : Type::TypeBase { using Base::Base; static constexpr StringLiteral name = "hal.buffer_view"; @@ -98,23 +97,23 @@ struct BufferViewType Value inferSizeFromValue(Location loc, Value value, OpBuilder &builder) const; }; -struct ChannelType : public Type::TypeBase { +struct ChannelType : Type::TypeBase { using Base::Base; static constexpr StringLiteral name = "hal.channel"; }; struct CommandBufferType - : public Type::TypeBase { + : Type::TypeBase { using Base::Base; static constexpr StringLiteral name = "hal.command_buffer"; }; struct DeviceType - : public Type::TypeBase { + : Type::TypeBase { using Base::Base; static constexpr StringLiteral name = "hal.device"; @@ -126,32 +125,31 @@ struct DeviceType static Value resolveAny(Location loc, OpBuilder &builder); }; -struct EventType : public Type::TypeBase { +struct EventType : Type::TypeBase { using Base::Base; static constexpr StringLiteral name = "hal.event"; }; -struct ExecutableType - : public Type::TypeBase { +struct ExecutableType : Type::TypeBase { using Base::Base; static constexpr StringLiteral name = "hal.executable"; }; -struct FenceType : public Type::TypeBase { +struct FenceType : Type::TypeBase { using Base::Base; static constexpr StringLiteral name = "hal.fence"; }; -struct FileType : public Type::TypeBase { +struct FileType : Type::TypeBase { using Base::Base; static constexpr StringLiteral name = "hal.file"; }; -struct SemaphoreType : public Type::TypeBase { +struct SemaphoreType : Type::TypeBase { using Base::Base; static constexpr StringLiteral name = "hal.semaphore"; diff --git a/compiler/src/iree/compiler/Dialect/HAL/Transforms/AnnotateTargetDevices.cpp b/compiler/src/iree/compiler/Dialect/HAL/Transforms/AnnotateTargetDevices.cpp index 1d0d9b6a526f..b9c5cac937ea 100644 --- a/compiler/src/iree/compiler/Dialect/HAL/Transforms/AnnotateTargetDevices.cpp +++ b/compiler/src/iree/compiler/Dialect/HAL/Transforms/AnnotateTargetDevices.cpp @@ -107,7 +107,7 @@ static void annotateFuncOp(FunctionOpInterface funcOp, } struct AnnotateTargetDevicesPass - : public IREE::HAL::impl::AnnotateTargetDevicesPassBase< + : IREE::HAL::impl::AnnotateTargetDevicesPassBase< AnnotateTargetDevicesPass> { void runOnOperation() override { // Run device analysis on the whole module. diff --git a/compiler/src/iree/compiler/Dialect/HAL/Transforms/AssignLegacyTargetDevices.cpp b/compiler/src/iree/compiler/Dialect/HAL/Transforms/AssignLegacyTargetDevices.cpp index e672b75ad724..ea01c311de6c 100644 --- a/compiler/src/iree/compiler/Dialect/HAL/Transforms/AssignLegacyTargetDevices.cpp +++ b/compiler/src/iree/compiler/Dialect/HAL/Transforms/AssignLegacyTargetDevices.cpp @@ -32,7 +32,7 @@ namespace { //===----------------------------------------------------------------------===// struct AssignLegacyTargetDevicesPass - : public IREE::HAL::impl::AssignLegacyTargetDevicesPassBase< + : IREE::HAL::impl::AssignLegacyTargetDevicesPassBase< AssignLegacyTargetDevicesPass> { using IREE::HAL::impl::AssignLegacyTargetDevicesPassBase< AssignLegacyTargetDevicesPass>::AssignLegacyTargetDevicesPassBase; diff --git a/compiler/src/iree/compiler/Dialect/HAL/Transforms/AssignTargetDevices.cpp b/compiler/src/iree/compiler/Dialect/HAL/Transforms/AssignTargetDevices.cpp index 7d39f3ad0161..ccb54b4ef7f1 100644 --- a/compiler/src/iree/compiler/Dialect/HAL/Transforms/AssignTargetDevices.cpp +++ b/compiler/src/iree/compiler/Dialect/HAL/Transforms/AssignTargetDevices.cpp @@ -187,8 +187,7 @@ static FailureOr parseTargetSpec(Location loc, } struct AssignTargetDevicesPass - : public IREE::HAL::impl::AssignTargetDevicesPassBase< - AssignTargetDevicesPass> { + : IREE::HAL::impl::AssignTargetDevicesPassBase { using IREE::HAL::impl::AssignTargetDevicesPassBase< AssignTargetDevicesPass>::AssignTargetDevicesPassBase; diff --git a/compiler/src/iree/compiler/Dialect/HAL/Transforms/CaptureExecutableSources.cpp b/compiler/src/iree/compiler/Dialect/HAL/Transforms/CaptureExecutableSources.cpp index cd3c5bfd86d5..04fc70431760 100644 --- a/compiler/src/iree/compiler/Dialect/HAL/Transforms/CaptureExecutableSources.cpp +++ b/compiler/src/iree/compiler/Dialect/HAL/Transforms/CaptureExecutableSources.cpp @@ -56,7 +56,7 @@ static Attribute getSourceAttr(MLIRContext *context, StringRef fileName, } struct CaptureExecutableSourcesPass - : public IREE::HAL::impl::CaptureExecutableSourcesPassBase< + : IREE::HAL::impl::CaptureExecutableSourcesPassBase< CaptureExecutableSourcesPass> { using IREE::HAL::impl::CaptureExecutableSourcesPassBase< CaptureExecutableSourcesPass>::CaptureExecutableSourcesPassBase; diff --git a/compiler/src/iree/compiler/Dialect/HAL/Transforms/ConfigureExecutables.cpp b/compiler/src/iree/compiler/Dialect/HAL/Transforms/ConfigureExecutables.cpp index ec66c35f7b6e..9b5c0b049200 100644 --- a/compiler/src/iree/compiler/Dialect/HAL/Transforms/ConfigureExecutables.cpp +++ b/compiler/src/iree/compiler/Dialect/HAL/Transforms/ConfigureExecutables.cpp @@ -106,8 +106,7 @@ class ConfigureTargetExecutableVariantsPass //===----------------------------------------------------------------------===// struct ConfigureExecutablesPass - : public IREE::HAL::impl::ConfigureExecutablesPassBase< - ConfigureExecutablesPass> { + : IREE::HAL::impl::ConfigureExecutablesPassBase { using IREE::HAL::impl::ConfigureExecutablesPassBase< ConfigureExecutablesPass>::ConfigureExecutablesPassBase; diff --git a/compiler/src/iree/compiler/Dialect/HAL/Transforms/ConvertToHAL.cpp b/compiler/src/iree/compiler/Dialect/HAL/Transforms/ConvertToHAL.cpp index 8627abda6651..048f1c97d424 100644 --- a/compiler/src/iree/compiler/Dialect/HAL/Transforms/ConvertToHAL.cpp +++ b/compiler/src/iree/compiler/Dialect/HAL/Transforms/ConvertToHAL.cpp @@ -59,7 +59,7 @@ static void stripExportRegions(ModuleOp moduleOp) { } struct ConvertToHALPass - : public IREE::HAL::impl::ConvertToHALPassBase { + : IREE::HAL::impl::ConvertToHALPassBase { void runOnOperation() override { auto *context = &getContext(); mlir::ModuleOp moduleOp = getOperation(); diff --git a/compiler/src/iree/compiler/Dialect/HAL/Transforms/DumpExecutableBenchmarks.cpp b/compiler/src/iree/compiler/Dialect/HAL/Transforms/DumpExecutableBenchmarks.cpp index 0ec0cde692f1..95d5dc1394c3 100644 --- a/compiler/src/iree/compiler/Dialect/HAL/Transforms/DumpExecutableBenchmarks.cpp +++ b/compiler/src/iree/compiler/Dialect/HAL/Transforms/DumpExecutableBenchmarks.cpp @@ -469,7 +469,7 @@ static void dumpModuleToStream(mlir::ModuleOp moduleOp, StringRef fileName, //===----------------------------------------------------------------------===// struct DumpExecutableBenchmarksPass - : public IREE::HAL::impl::DumpExecutableBenchmarksPassBase< + : IREE::HAL::impl::DumpExecutableBenchmarksPassBase< DumpExecutableBenchmarksPass> { using IREE::HAL::impl::DumpExecutableBenchmarksPassBase< DumpExecutableBenchmarksPass>::DumpExecutableBenchmarksPassBase; diff --git a/compiler/src/iree/compiler/Dialect/HAL/Transforms/DumpExecutableSources.cpp b/compiler/src/iree/compiler/Dialect/HAL/Transforms/DumpExecutableSources.cpp index 2e68ab504b05..be509e0f9330 100644 --- a/compiler/src/iree/compiler/Dialect/HAL/Transforms/DumpExecutableSources.cpp +++ b/compiler/src/iree/compiler/Dialect/HAL/Transforms/DumpExecutableSources.cpp @@ -37,7 +37,7 @@ static void dumpExecutableToStream(IREE::HAL::ExecutableOp executableOp, //===----------------------------------------------------------------------===// struct DumpExecutableSourcesPass - : public IREE::HAL::impl::DumpExecutableSourcesPassBase< + : IREE::HAL::impl::DumpExecutableSourcesPassBase< DumpExecutableSourcesPass> { using IREE::HAL::impl::DumpExecutableSourcesPassBase< DumpExecutableSourcesPass>::DumpExecutableSourcesPassBase; diff --git a/compiler/src/iree/compiler/Dialect/HAL/Transforms/ElideRedundantCommands.cpp b/compiler/src/iree/compiler/Dialect/HAL/Transforms/ElideRedundantCommands.cpp index d2d284ed72c6..d845bf211d91 100644 --- a/compiler/src/iree/compiler/Dialect/HAL/Transforms/ElideRedundantCommands.cpp +++ b/compiler/src/iree/compiler/Dialect/HAL/Transforms/ElideRedundantCommands.cpp @@ -66,7 +66,7 @@ static void processOp(IREE::HAL::CommandBufferExecutionBarrierOp op, //===----------------------------------------------------------------------===// struct ElideRedundantCommandsPass - : public IREE::HAL::impl::ElideRedundantCommandsPassBase< + : IREE::HAL::impl::ElideRedundantCommandsPassBase< ElideRedundantCommandsPass> { void runOnOperation() override { auto parentOp = getOperation(); diff --git a/compiler/src/iree/compiler/Dialect/HAL/Transforms/HoistExecutableObjects.cpp b/compiler/src/iree/compiler/Dialect/HAL/Transforms/HoistExecutableObjects.cpp index 713c6a76d4ac..4da6e0a098d6 100644 --- a/compiler/src/iree/compiler/Dialect/HAL/Transforms/HoistExecutableObjects.cpp +++ b/compiler/src/iree/compiler/Dialect/HAL/Transforms/HoistExecutableObjects.cpp @@ -24,7 +24,7 @@ namespace { //===----------------------------------------------------------------------===// struct HoistExecutableObjectsPass - : public IREE::HAL::impl::HoistExecutableObjectsPassBase< + : IREE::HAL::impl::HoistExecutableObjectsPassBase< HoistExecutableObjectsPass> { void runOnOperation() override { // Note that some executables may be external and not have any contents. diff --git a/compiler/src/iree/compiler/Dialect/HAL/Transforms/InitializeDevices.cpp b/compiler/src/iree/compiler/Dialect/HAL/Transforms/InitializeDevices.cpp index 400dc349e175..c4336e84795d 100644 --- a/compiler/src/iree/compiler/Dialect/HAL/Transforms/InitializeDevices.cpp +++ b/compiler/src/iree/compiler/Dialect/HAL/Transforms/InitializeDevices.cpp @@ -91,7 +91,7 @@ static void initializeDeviceGlobal( //===----------------------------------------------------------------------===// struct InitializeDevicesPass - : public IREE::HAL::impl::InitializeDevicesPassBase { + : IREE::HAL::impl::InitializeDevicesPassBase { using IREE::HAL::impl::InitializeDevicesPassBase< InitializeDevicesPass>::InitializeDevicesPassBase; void runOnOperation() override { diff --git a/compiler/src/iree/compiler/Dialect/HAL/Transforms/InlineMemoizeRegions.cpp b/compiler/src/iree/compiler/Dialect/HAL/Transforms/InlineMemoizeRegions.cpp index bf62add7586f..c1ee73e17280 100644 --- a/compiler/src/iree/compiler/Dialect/HAL/Transforms/InlineMemoizeRegions.cpp +++ b/compiler/src/iree/compiler/Dialect/HAL/Transforms/InlineMemoizeRegions.cpp @@ -28,8 +28,7 @@ namespace { //===----------------------------------------------------------------------===// struct InlineMemoizeRegionsPass - : public IREE::HAL::impl::InlineMemoizeRegionsPassBase< - InlineMemoizeRegionsPass> { + : IREE::HAL::impl::InlineMemoizeRegionsPassBase { void runOnOperation() override { auto parentOp = getOperation(); SmallVector memoizeOps; diff --git a/compiler/src/iree/compiler/Dialect/HAL/Transforms/LinkExecutables.cpp b/compiler/src/iree/compiler/Dialect/HAL/Transforms/LinkExecutables.cpp index 52f12e2f6042..dcff16873f0b 100644 --- a/compiler/src/iree/compiler/Dialect/HAL/Transforms/LinkExecutables.cpp +++ b/compiler/src/iree/compiler/Dialect/HAL/Transforms/LinkExecutables.cpp @@ -33,7 +33,7 @@ namespace { //===----------------------------------------------------------------------===// struct LinkTargetExecutablesPass - : public IREE::HAL::impl::LinkTargetExecutablesPassBase< + : IREE::HAL::impl::LinkTargetExecutablesPassBase< LinkTargetExecutablesPass> { using IREE::HAL::impl::LinkTargetExecutablesPassBase< LinkTargetExecutablesPass>::LinkTargetExecutablesPassBase; @@ -70,8 +70,7 @@ struct LinkTargetExecutablesPass //===----------------------------------------------------------------------===// struct LinkAllExecutablesPass - : public IREE::HAL::impl::LinkAllExecutablesPassBase< - LinkAllExecutablesPass> { + : IREE::HAL::impl::LinkAllExecutablesPassBase { using IREE::HAL::impl::LinkAllExecutablesPassBase< LinkAllExecutablesPass>::LinkAllExecutablesPassBase; void runOnOperation() override { diff --git a/compiler/src/iree/compiler/Dialect/HAL/Transforms/MaterializeDispatchInstrumentation.cpp b/compiler/src/iree/compiler/Dialect/HAL/Transforms/MaterializeDispatchInstrumentation.cpp index 7a75fc5b992d..e1ada71d497a 100644 --- a/compiler/src/iree/compiler/Dialect/HAL/Transforms/MaterializeDispatchInstrumentation.cpp +++ b/compiler/src/iree/compiler/Dialect/HAL/Transforms/MaterializeDispatchInstrumentation.cpp @@ -102,7 +102,7 @@ static void appendListItems(Location loc, Value list, ArrayRef items, //===----------------------------------------------------------------------===// struct MaterializeDispatchInstrumentationPass - : public IREE::HAL::impl::MaterializeDispatchInstrumentationPassBase< + : IREE::HAL::impl::MaterializeDispatchInstrumentationPassBase< MaterializeDispatchInstrumentationPass> { using IREE::HAL::impl::MaterializeDispatchInstrumentationPassBase< MaterializeDispatchInstrumentationPass>:: diff --git a/compiler/src/iree/compiler/Dialect/HAL/Transforms/MaterializeInterfaces.cpp b/compiler/src/iree/compiler/Dialect/HAL/Transforms/MaterializeInterfaces.cpp index 4d0022eff77f..671c71677337 100644 --- a/compiler/src/iree/compiler/Dialect/HAL/Transforms/MaterializeInterfaces.cpp +++ b/compiler/src/iree/compiler/Dialect/HAL/Transforms/MaterializeInterfaces.cpp @@ -500,7 +500,7 @@ declareEntryPointOps(IREE::Stream::ExecutableOp sourceExecutableOp, namespace { -struct ConvertReturnPattern : public OpRewritePattern { +struct ConvertReturnPattern : OpRewritePattern { using Base::Base; LogicalResult matchAndRewrite(IREE::Stream::ReturnOp op, PatternRewriter &rewriter) const override { @@ -510,8 +510,7 @@ struct ConvertReturnPattern : public OpRewritePattern { }; template -struct ConvertDispatchWorkgroupInfoPattern final - : public OpRewritePattern { +struct ConvertDispatchWorkgroupInfoPattern final : OpRewritePattern { using OpRewritePattern::OpRewritePattern; LogicalResult matchAndRewrite(SrcOp op, PatternRewriter &rewriter) const override { @@ -523,7 +522,7 @@ struct ConvertDispatchWorkgroupInfoPattern final }; struct InlineConstantWorkgroupSizePattern - : public OpRewritePattern { + : OpRewritePattern { using Base::Base; LogicalResult matchAndRewrite(IREE::HAL::InterfaceWorkgroupSizeOp sizeOp, PatternRewriter &rewriter) const override { @@ -570,7 +569,7 @@ convertDispatchWorkgroupInfoOps(IREE::HAL::ExecutableOp executableOp) { //===----------------------------------------------------------------------===// struct MaterializeInterfacesPass - : public IREE::HAL::impl::MaterializeInterfacesPassBase< + : IREE::HAL::impl::MaterializeInterfacesPassBase< MaterializeInterfacesPass> { void runOnOperation() override { mlir::ModuleOp moduleOp = getOperation(); diff --git a/compiler/src/iree/compiler/Dialect/HAL/Transforms/MaterializeResourceCaches.cpp b/compiler/src/iree/compiler/Dialect/HAL/Transforms/MaterializeResourceCaches.cpp index afd23206fd4a..49ae09758a11 100644 --- a/compiler/src/iree/compiler/Dialect/HAL/Transforms/MaterializeResourceCaches.cpp +++ b/compiler/src/iree/compiler/Dialect/HAL/Transforms/MaterializeResourceCaches.cpp @@ -469,7 +469,7 @@ static LogicalResult gatherDeviceResources( } struct MaterializeResourceCachesPass - : public IREE::HAL::impl::MaterializeResourceCachesPassBase< + : IREE::HAL::impl::MaterializeResourceCachesPassBase< MaterializeResourceCachesPass> { void runOnOperation() override { mlir::ModuleOp moduleOp = getOperation(); diff --git a/compiler/src/iree/compiler/Dialect/HAL/Transforms/MaterializeTargetDevices.cpp b/compiler/src/iree/compiler/Dialect/HAL/Transforms/MaterializeTargetDevices.cpp index bcf375bf002d..2158ea40713b 100644 --- a/compiler/src/iree/compiler/Dialect/HAL/Transforms/MaterializeTargetDevices.cpp +++ b/compiler/src/iree/compiler/Dialect/HAL/Transforms/MaterializeTargetDevices.cpp @@ -174,7 +174,7 @@ static void assignDefaultDeviceAffinity(mlir::ModuleOp moduleOp, } struct MaterializeTargetDevicesPass - : public IREE::HAL::impl::MaterializeTargetDevicesPassBase< + : IREE::HAL::impl::MaterializeTargetDevicesPassBase< MaterializeTargetDevicesPass> { using IREE::HAL::impl::MaterializeTargetDevicesPassBase< MaterializeTargetDevicesPass>::MaterializeTargetDevicesPassBase; diff --git a/compiler/src/iree/compiler/Dialect/HAL/Transforms/MemoizeDeviceQueries.cpp b/compiler/src/iree/compiler/Dialect/HAL/Transforms/MemoizeDeviceQueries.cpp index 78a353eeb86c..58174e13f67f 100644 --- a/compiler/src/iree/compiler/Dialect/HAL/Transforms/MemoizeDeviceQueries.cpp +++ b/compiler/src/iree/compiler/Dialect/HAL/Transforms/MemoizeDeviceQueries.cpp @@ -60,8 +60,7 @@ static std::string getDeviceNamePrefix(IREE::Util::GlobalOpInterface deviceOp) { } struct MemoizeDeviceQueriesPass - : public IREE::HAL::impl::MemoizeDeviceQueriesPassBase< - MemoizeDeviceQueriesPass> { + : IREE::HAL::impl::MemoizeDeviceQueriesPassBase { void runOnOperation() override { mlir::ModuleOp moduleOp = getOperation(); diff --git a/compiler/src/iree/compiler/Dialect/HAL/Transforms/MemoizeDeviceSelection.cpp b/compiler/src/iree/compiler/Dialect/HAL/Transforms/MemoizeDeviceSelection.cpp index 1947dfc3ef27..56f8d98655dd 100644 --- a/compiler/src/iree/compiler/Dialect/HAL/Transforms/MemoizeDeviceSelection.cpp +++ b/compiler/src/iree/compiler/Dialect/HAL/Transforms/MemoizeDeviceSelection.cpp @@ -144,7 +144,7 @@ static LogicalResult memoizeAllocatorSelectOp( } struct MemoizeDeviceSelectionPass - : public IREE::HAL::impl::MemoizeDeviceSelectionPassBase< + : IREE::HAL::impl::MemoizeDeviceSelectionPassBase< MemoizeDeviceSelectionPass> { void runOnOperation() override { mlir::ModuleOp moduleOp = getOperation(); diff --git a/compiler/src/iree/compiler/Dialect/HAL/Transforms/OutlineMemoizeRegions.cpp b/compiler/src/iree/compiler/Dialect/HAL/Transforms/OutlineMemoizeRegions.cpp index 75a174b28cf8..047f5e447616 100644 --- a/compiler/src/iree/compiler/Dialect/HAL/Transforms/OutlineMemoizeRegions.cpp +++ b/compiler/src/iree/compiler/Dialect/HAL/Transforms/OutlineMemoizeRegions.cpp @@ -575,7 +575,7 @@ static void memoizeRegionOp(IREE::HAL::DeviceMemoizeOp memoizeOp, } struct OutlineMemoizeRegionsPass - : public IREE::HAL::impl::OutlineMemoizeRegionsPassBase< + : IREE::HAL::impl::OutlineMemoizeRegionsPassBase< OutlineMemoizeRegionsPass> { void runOnOperation() override { mlir::ModuleOp moduleOp = getOperation(); diff --git a/compiler/src/iree/compiler/Dialect/HAL/Transforms/Passes.cpp b/compiler/src/iree/compiler/Dialect/HAL/Transforms/Passes.cpp index e3b4459ef52b..94774b209ce3 100644 --- a/compiler/src/iree/compiler/Dialect/HAL/Transforms/Passes.cpp +++ b/compiler/src/iree/compiler/Dialect/HAL/Transforms/Passes.cpp @@ -25,7 +25,7 @@ namespace mlir::iree_compiler::IREE::HAL { namespace { -struct TransformOptions : public PassPipelineOptions { +struct TransformOptions : PassPipelineOptions { Option serializeExecutables{ *this, "serialize-executables", diff --git a/compiler/src/iree/compiler/Dialect/HAL/Transforms/Passes.h b/compiler/src/iree/compiler/Dialect/HAL/Transforms/Passes.h index e3231c3fd05a..e246204024ae 100644 --- a/compiler/src/iree/compiler/Dialect/HAL/Transforms/Passes.h +++ b/compiler/src/iree/compiler/Dialect/HAL/Transforms/Passes.h @@ -46,7 +46,7 @@ struct PipelineHooks { std::function afterPhase; }; -struct AssignmentOptions : public PassPipelineOptions { +struct AssignmentOptions : PassPipelineOptions { // TODO(benvanik): remove the legacy flag once users are switched to devices. ListOption legacyTargetBackends{ *this, diff --git a/compiler/src/iree/compiler/Dialect/HAL/Transforms/PreprocessExecutables.cpp b/compiler/src/iree/compiler/Dialect/HAL/Transforms/PreprocessExecutables.cpp index 9a0e0954b98b..4b580e9b6c2e 100644 --- a/compiler/src/iree/compiler/Dialect/HAL/Transforms/PreprocessExecutables.cpp +++ b/compiler/src/iree/compiler/Dialect/HAL/Transforms/PreprocessExecutables.cpp @@ -225,7 +225,7 @@ static LogicalResult preprocessWithCommand(IREE::HAL::ExecutableOp executableOp, //===----------------------------------------------------------------------===// struct PreprocessExecutablesWithPipelinePass - : public IREE::HAL::impl::PreprocessExecutablesWithPipelinePassBase< + : IREE::HAL::impl::PreprocessExecutablesWithPipelinePassBase< PreprocessExecutablesWithPipelinePass> { using IREE::HAL::impl::PreprocessExecutablesWithPipelinePassBase< PreprocessExecutablesWithPipelinePass>:: @@ -268,7 +268,7 @@ struct PreprocessExecutablesWithPipelinePass //===----------------------------------------------------------------------===// struct PreprocessExecutablesWithToolPass - : public IREE::HAL::impl::PreprocessExecutablesWithToolPassBase< + : IREE::HAL::impl::PreprocessExecutablesWithToolPassBase< PreprocessExecutablesWithToolPass> { using IREE::HAL::impl::PreprocessExecutablesWithToolPassBase< PreprocessExecutablesWithToolPass>::PreprocessExecutablesWithToolPassBase; diff --git a/compiler/src/iree/compiler/Dialect/HAL/Transforms/PruneExecutables.cpp b/compiler/src/iree/compiler/Dialect/HAL/Transforms/PruneExecutables.cpp index 19fd69e6a205..f8562bb45c03 100644 --- a/compiler/src/iree/compiler/Dialect/HAL/Transforms/PruneExecutables.cpp +++ b/compiler/src/iree/compiler/Dialect/HAL/Transforms/PruneExecutables.cpp @@ -96,7 +96,7 @@ static void eraseOps(ArrayRef symbolRefAttrs, //===----------------------------------------------------------------------===// struct PruneExecutablesPass - : public IREE::HAL::impl::PruneExecutablesPassBase { + : IREE::HAL::impl::PruneExecutablesPassBase { void runOnOperation() override { mlir::ModuleOp moduleOp = getOperation(); diff --git a/compiler/src/iree/compiler/Dialect/HAL/Transforms/RepeatDispatches.cpp b/compiler/src/iree/compiler/Dialect/HAL/Transforms/RepeatDispatches.cpp index e03a03e0d474..6c40c8ea6054 100644 --- a/compiler/src/iree/compiler/Dialect/HAL/Transforms/RepeatDispatches.cpp +++ b/compiler/src/iree/compiler/Dialect/HAL/Transforms/RepeatDispatches.cpp @@ -22,7 +22,7 @@ namespace { //===----------------------------------------------------------------------===// struct RepeatDispatchesPass - : public IREE::HAL::impl::RepeatDispatchesPassBase { + : IREE::HAL::impl::RepeatDispatchesPassBase { using IREE::HAL::impl::RepeatDispatchesPassBase< RepeatDispatchesPass>::RepeatDispatchesPassBase; void runOnOperation() override { diff --git a/compiler/src/iree/compiler/Dialect/HAL/Transforms/ResolveDeviceAliases.cpp b/compiler/src/iree/compiler/Dialect/HAL/Transforms/ResolveDeviceAliases.cpp index 7f45bf0f6cae..e833eb175ce7 100644 --- a/compiler/src/iree/compiler/Dialect/HAL/Transforms/ResolveDeviceAliases.cpp +++ b/compiler/src/iree/compiler/Dialect/HAL/Transforms/ResolveDeviceAliases.cpp @@ -111,8 +111,7 @@ resolveNestedAliasAttrs(Operation *forOp, Attribute attr, } struct ResolveDeviceAliasesPass - : public IREE::HAL::impl::ResolveDeviceAliasesPassBase< - ResolveDeviceAliasesPass> { + : IREE::HAL::impl::ResolveDeviceAliasesPassBase { using IREE::HAL::impl::ResolveDeviceAliasesPassBase< ResolveDeviceAliasesPass>::ResolveDeviceAliasesPassBase; void runOnOperation() override { diff --git a/compiler/src/iree/compiler/Dialect/HAL/Transforms/ResolveDevicePromises.cpp b/compiler/src/iree/compiler/Dialect/HAL/Transforms/ResolveDevicePromises.cpp index e37ea9a662e2..ce281ebf20ab 100644 --- a/compiler/src/iree/compiler/Dialect/HAL/Transforms/ResolveDevicePromises.cpp +++ b/compiler/src/iree/compiler/Dialect/HAL/Transforms/ResolveDevicePromises.cpp @@ -28,7 +28,7 @@ namespace { //===----------------------------------------------------------------------===// struct ResolveDevicePromisesPass - : public IREE::HAL::impl::ResolveDevicePromisesPassBase< + : IREE::HAL::impl::ResolveDevicePromisesPassBase< ResolveDevicePromisesPass> { using IREE::HAL::impl::ResolveDevicePromisesPassBase< ResolveDevicePromisesPass>::ResolveDevicePromisesPassBase; diff --git a/compiler/src/iree/compiler/Dialect/HAL/Transforms/ResolveExportOrdinals.cpp b/compiler/src/iree/compiler/Dialect/HAL/Transforms/ResolveExportOrdinals.cpp index 2d7d3d0b6168..aa9fec84dca8 100644 --- a/compiler/src/iree/compiler/Dialect/HAL/Transforms/ResolveExportOrdinals.cpp +++ b/compiler/src/iree/compiler/Dialect/HAL/Transforms/ResolveExportOrdinals.cpp @@ -22,7 +22,7 @@ namespace { //===----------------------------------------------------------------------===// struct ResolveExportOrdinalsPass - : public IREE::HAL::impl::ResolveExportOrdinalsPassBase< + : IREE::HAL::impl::ResolveExportOrdinalsPassBase< ResolveExportOrdinalsPass> { void runOnOperation() override { mlir::ModuleOp moduleOp = getOperation(); diff --git a/compiler/src/iree/compiler/Dialect/HAL/Transforms/ResolveTopologyQueries.cpp b/compiler/src/iree/compiler/Dialect/HAL/Transforms/ResolveTopologyQueries.cpp index 704634aca684..7ce542283714 100644 --- a/compiler/src/iree/compiler/Dialect/HAL/Transforms/ResolveTopologyQueries.cpp +++ b/compiler/src/iree/compiler/Dialect/HAL/Transforms/ResolveTopologyQueries.cpp @@ -207,7 +207,7 @@ resolveMemoryPropertiesOp(AllocatorResolveMemoryPropertiesOp op, //===----------------------------------------------------------------------===// struct ResolveTopologyQueriesPass - : public impl::ResolveTopologyQueriesPassBase { + : impl::ResolveTopologyQueriesPassBase { void runOnOperation() override { mlir::ModuleOp moduleOp = getOperation(); diff --git a/compiler/src/iree/compiler/Dialect/HAL/Transforms/SerializeExecutables.cpp b/compiler/src/iree/compiler/Dialect/HAL/Transforms/SerializeExecutables.cpp index 2a805a30e6f1..9c5c3b1596c8 100644 --- a/compiler/src/iree/compiler/Dialect/HAL/Transforms/SerializeExecutables.cpp +++ b/compiler/src/iree/compiler/Dialect/HAL/Transforms/SerializeExecutables.cpp @@ -34,7 +34,7 @@ namespace { //===----------------------------------------------------------------------===// struct SerializeTargetExecutablesPass - : public IREE::HAL::impl::SerializeTargetExecutablesPassBase< + : IREE::HAL::impl::SerializeTargetExecutablesPassBase< SerializeTargetExecutablesPass> { using IREE::HAL::impl::SerializeTargetExecutablesPassBase< SerializeTargetExecutablesPass>::SerializeTargetExecutablesPassBase; @@ -101,7 +101,7 @@ struct SerializeTargetExecutablesPass //===----------------------------------------------------------------------===// struct SerializeAllExecutablesPass - : public IREE::HAL::impl::SerializeAllExecutablesPassBase< + : IREE::HAL::impl::SerializeAllExecutablesPassBase< SerializeAllExecutablesPass> { using IREE::HAL::impl::SerializeAllExecutablesPassBase< SerializeAllExecutablesPass>::SerializeAllExecutablesPassBase; diff --git a/compiler/src/iree/compiler/Dialect/HAL/Transforms/StripExecutableContents.cpp b/compiler/src/iree/compiler/Dialect/HAL/Transforms/StripExecutableContents.cpp index bcd86da2d931..ae6f3242cb23 100644 --- a/compiler/src/iree/compiler/Dialect/HAL/Transforms/StripExecutableContents.cpp +++ b/compiler/src/iree/compiler/Dialect/HAL/Transforms/StripExecutableContents.cpp @@ -19,7 +19,7 @@ namespace { //===----------------------------------------------------------------------===// struct StripExecutableContentsPass - : public IREE::HAL::impl::StripExecutableContentsPassBase< + : IREE::HAL::impl::StripExecutableContentsPassBase< StripExecutableContentsPass> { void runOnOperation() override { for (auto executableOp : getOperation().getOps()) { diff --git a/compiler/src/iree/compiler/Dialect/HAL/Transforms/SubstituteExecutables.cpp b/compiler/src/iree/compiler/Dialect/HAL/Transforms/SubstituteExecutables.cpp index 80dc320476ab..02dda0953228 100644 --- a/compiler/src/iree/compiler/Dialect/HAL/Transforms/SubstituteExecutables.cpp +++ b/compiler/src/iree/compiler/Dialect/HAL/Transforms/SubstituteExecutables.cpp @@ -213,7 +213,7 @@ substituteExecutableOp(IREE::HAL::ExecutableOp executableOp, //===----------------------------------------------------------------------===// struct SubstituteExecutablesPass - : public IREE::HAL::impl::SubstituteExecutablesPassBase< + : IREE::HAL::impl::SubstituteExecutablesPassBase< SubstituteExecutablesPass> { using IREE::HAL::impl::SubstituteExecutablesPassBase< SubstituteExecutablesPass>::SubstituteExecutablesPassBase; diff --git a/compiler/src/iree/compiler/Dialect/HAL/Transforms/TranslateExecutables.cpp b/compiler/src/iree/compiler/Dialect/HAL/Transforms/TranslateExecutables.cpp index ff7ef45bb06a..7cd58d2fdc6e 100644 --- a/compiler/src/iree/compiler/Dialect/HAL/Transforms/TranslateExecutables.cpp +++ b/compiler/src/iree/compiler/Dialect/HAL/Transforms/TranslateExecutables.cpp @@ -34,7 +34,7 @@ namespace { //===----------------------------------------------------------------------===// struct TranslateTargetExecutableVariantsPass - : public IREE::HAL::impl::TranslateTargetExecutableVariantsPassBase< + : IREE::HAL::impl::TranslateTargetExecutableVariantsPassBase< TranslateTargetExecutableVariantsPass> { using IREE::HAL::impl::TranslateTargetExecutableVariantsPassBase< TranslateTargetExecutableVariantsPass>:: @@ -105,7 +105,7 @@ struct TranslateTargetExecutableVariantsPass //===----------------------------------------------------------------------===// struct TranslateAllExecutablesPass - : public IREE::HAL::impl::TranslateAllExecutablesPassBase< + : IREE::HAL::impl::TranslateAllExecutablesPassBase< TranslateAllExecutablesPass> { using IREE::HAL::impl::TranslateAllExecutablesPassBase< TranslateAllExecutablesPass>::TranslateAllExecutablesPassBase; diff --git a/compiler/src/iree/compiler/Dialect/HAL/Transforms/VerifyDevices.cpp b/compiler/src/iree/compiler/Dialect/HAL/Transforms/VerifyDevices.cpp index ee11304b2793..32a099e6cbef 100644 --- a/compiler/src/iree/compiler/Dialect/HAL/Transforms/VerifyDevices.cpp +++ b/compiler/src/iree/compiler/Dialect/HAL/Transforms/VerifyDevices.cpp @@ -95,7 +95,7 @@ static LogicalResult verifyAttr(Operation *deviceOp, Attribute attr, } struct VerifyDevicesPass - : public IREE::HAL::impl::VerifyDevicesPassBase { + : IREE::HAL::impl::VerifyDevicesPassBase { using IREE::HAL::impl::VerifyDevicesPassBase< VerifyDevicesPass>::VerifyDevicesPassBase; void runOnOperation() override { diff --git a/compiler/src/iree/compiler/Dialect/LinalgExt/IR/LinalgExtDialect.cpp b/compiler/src/iree/compiler/Dialect/LinalgExt/IR/LinalgExtDialect.cpp index dffed1e456e1..80f983bd6917 100644 --- a/compiler/src/iree/compiler/Dialect/LinalgExt/IR/LinalgExtDialect.cpp +++ b/compiler/src/iree/compiler/Dialect/LinalgExt/IR/LinalgExtDialect.cpp @@ -32,7 +32,7 @@ using namespace mlir::iree_compiler::IREE::LinalgExt; // Used to control inlining behavior. namespace { -struct IREELinalgExtInlinerInterface : public DialectInlinerInterface { +struct IREELinalgExtInlinerInterface : DialectInlinerInterface { using DialectInlinerInterface::DialectInlinerInterface; bool isLegalToInline(Operation *call, Operation *callable, @@ -53,7 +53,7 @@ struct IREELinalgExtInlinerInterface : public DialectInlinerInterface { } }; -struct IREELinalgExtDialectOpAsmInterface : public OpAsmDialectInterface { +struct IREELinalgExtDialectOpAsmInterface : OpAsmDialectInterface { using OpAsmDialectInterface::OpAsmDialectInterface; }; diff --git a/compiler/src/iree/compiler/Dialect/LinalgExt/IR/LinalgExtOps.cpp b/compiler/src/iree/compiler/Dialect/LinalgExt/IR/LinalgExtOps.cpp index ccb8368ba5a5..d494343b7eb8 100644 --- a/compiler/src/iree/compiler/Dialect/LinalgExt/IR/LinalgExtOps.cpp +++ b/compiler/src/iree/compiler/Dialect/LinalgExt/IR/LinalgExtOps.cpp @@ -332,7 +332,7 @@ namespace { /// expressions of other, more static, operands. This requires the operation to /// implement the DPS interface and to have indexing maps. template -struct StaticizeLinalgExtOp : public OpRewritePattern { +struct StaticizeLinalgExtOp : OpRewritePattern { using OpRewritePattern::OpRewritePattern; LogicalResult matchAndRewrite(OpTy op, PatternRewriter &rewriter) const override { @@ -496,8 +496,7 @@ SmallVector GatherOp::getIndexingMapsForResults() { } namespace { -struct ConvertGatherToExtract - : public OpRewritePattern { +struct ConvertGatherToExtract : OpRewritePattern { using Base::Base; LogicalResult matchAndRewrite(IREE::LinalgExt::GatherOp gatherOp, PatternRewriter &rewriter) const override { @@ -586,7 +585,7 @@ namespace { /// Convert an identity map_load or map_store to a copy operation. /// We keep the copy to preserve DPS semantics. template -struct ConvertIdentityMapLoadStoreToCopy : public OpRewritePattern { +struct ConvertIdentityMapLoadStoreToCopy : OpRewritePattern { using OpRewritePattern::OpRewritePattern; LogicalResult matchAndRewrite(OpTy op, @@ -1040,8 +1039,7 @@ namespace { /// Note: that we will not remove unused results if their associated block /// arguments are used within the comparator because that's needed for op /// functionality. -struct RemoveUnusedSortOpResults - : public OpRewritePattern { +struct RemoveUnusedSortOpResults : OpRewritePattern { using Base::Base; LogicalResult matchAndRewrite(IREE::LinalgExt::SortOp sortOp, PatternRewriter &rewriter) const override { diff --git a/compiler/src/iree/compiler/Dialect/LinalgExt/IR/TilingInterfaceImpl.cpp b/compiler/src/iree/compiler/Dialect/LinalgExt/IR/TilingInterfaceImpl.cpp index f977d86f92f9..95a0c7bf2b58 100644 --- a/compiler/src/iree/compiler/Dialect/LinalgExt/IR/TilingInterfaceImpl.cpp +++ b/compiler/src/iree/compiler/Dialect/LinalgExt/IR/TilingInterfaceImpl.cpp @@ -3612,8 +3612,8 @@ LogicalResult CustomOp::getResultTilePosition( namespace { struct ConcatOpTilingExternalModel - : public TilingInterface::ExternalModel { + : TilingInterface::ExternalModel { SmallVector getLoopIteratorTypes(Operation *op) const { auto concatOp = cast(op); SmallVector iteratorTypes( diff --git a/compiler/src/iree/compiler/Dialect/LinalgExt/Transforms/ConvertToLoops.cpp b/compiler/src/iree/compiler/Dialect/LinalgExt/Transforms/ConvertToLoops.cpp index 24059dc9fdcd..91ee44a1ed40 100644 --- a/compiler/src/iree/compiler/Dialect/LinalgExt/Transforms/ConvertToLoops.cpp +++ b/compiler/src/iree/compiler/Dialect/LinalgExt/Transforms/ConvertToLoops.cpp @@ -64,7 +64,7 @@ static LogicalResult lowerToLoops(OpBuilder &builder, /// Pattern rewriter hook to lower a `TiledOpInterface` to loops. namespace { -struct TilingInterfaceLowerToLoopsPattern : public RewritePattern { +struct TilingInterfaceLowerToLoopsPattern : RewritePattern { TilingInterfaceLowerToLoopsPattern(MLIRContext *context, PatternBenefit benefit = 1) : RewritePattern(MatchAnyOpTypeTag(), benefit, context) {} diff --git a/compiler/src/iree/compiler/Dialect/LinalgExt/Transforms/DecomposeWinogradPass.cpp b/compiler/src/iree/compiler/Dialect/LinalgExt/Transforms/DecomposeWinogradPass.cpp index eec5b32468a7..521b5446dfb1 100644 --- a/compiler/src/iree/compiler/Dialect/LinalgExt/Transforms/DecomposeWinogradPass.cpp +++ b/compiler/src/iree/compiler/Dialect/LinalgExt/Transforms/DecomposeWinogradPass.cpp @@ -30,7 +30,7 @@ namespace { /// expected to tile most dimensions to 1, so the winograd op is only a small /// tile of rank 2 for decomposition. template -struct FoldWinogradOpUnitDims : public OpRewritePattern { +struct FoldWinogradOpUnitDims : OpRewritePattern { using OpRewritePattern::OpRewritePattern; LogicalResult matchAndRewrite(TransformOp transformOp, @@ -111,7 +111,7 @@ struct FoldWinogradOpUnitDims : public OpRewritePattern { /// outs(%init_1 : tensor<8x8xf32>) -> tensor<8x8xf32> /// ```` struct DecomposeWinogradFilterTransform - : public OpRewritePattern { + : OpRewritePattern { using Base::Base; LogicalResult matchAndRewrite(WinogradFilterTransformOp transformOp, @@ -193,7 +193,7 @@ struct DecomposeWinogradFilterTransform /// outs(%init_1 : tensor<8x8xf32>) -> tensor<8x8xf32> /// ```` struct DecomposeWinogradInputTransform - : public OpRewritePattern { + : OpRewritePattern { using Base::Base; LogicalResult matchAndRewrite(WinogradInputTransformOp transformOp, @@ -276,7 +276,7 @@ struct DecomposeWinogradInputTransform /// outs(%init_1 : tensor<6x6xf32>) -> tensor<6x6xf32> /// ```` struct DecomposeWinogradOutputTransform - : public OpRewritePattern { + : OpRewritePattern { using Base::Base; LogicalResult matchAndRewrite(WinogradOutputTransformOp transformOp, diff --git a/compiler/src/iree/compiler/Dialect/LinalgExt/Transforms/ReshapeFusion.cpp b/compiler/src/iree/compiler/Dialect/LinalgExt/Transforms/ReshapeFusion.cpp index 9bb3eae612c7..8fba4cd344ff 100644 --- a/compiler/src/iree/compiler/Dialect/LinalgExt/Transforms/ReshapeFusion.cpp +++ b/compiler/src/iree/compiler/Dialect/LinalgExt/Transforms/ReshapeFusion.cpp @@ -537,7 +537,7 @@ fuseWithReshapeByExpansion(OpTy op, Operation *reshapeOp, namespace { -struct DropScatterUnitIndexDepth final : public OpRewritePattern { +struct DropScatterUnitIndexDepth final : OpRewritePattern { using Base::Base; LogicalResult matchAndRewrite(ScatterOp scatterOp, PatternRewriter &rewriter) const override { @@ -649,7 +649,7 @@ Value rankExpandValue(RewriterBase &rewriter, Location loc, Value destVal, } } -struct DropMapStoreUnitDims final : public OpRewritePattern { +struct DropMapStoreUnitDims final : OpRewritePattern { using Base::Base; DropMapStoreUnitDims(MLIRContext *context, linalg::ControlDropUnitDims options, @@ -698,7 +698,7 @@ struct DropMapStoreUnitDims final : public OpRewritePattern { linalg::ControlDropUnitDims options; }; -struct DropGatherUnitDims final : public OpRewritePattern { +struct DropGatherUnitDims final : OpRewritePattern { DropGatherUnitDims(MLIRContext *context, linalg::ControlDropUnitDims options, PatternBenefit benefit = 1) : OpRewritePattern(context, benefit), @@ -769,7 +769,7 @@ struct DropGatherUnitDims final : public OpRewritePattern { linalg::ControlDropUnitDims options; }; -struct DropScatterUnitDims final : public OpRewritePattern { +struct DropScatterUnitDims final : OpRewritePattern { DropScatterUnitDims(MLIRContext *context, linalg::ControlDropUnitDims options, PatternBenefit benefit = 1) : OpRewritePattern(context, benefit), @@ -839,8 +839,7 @@ struct DropScatterUnitDims final : public OpRewritePattern { }; template -struct FoldWithProducerReshapeByExpansion final - : public OpRewritePattern { +struct FoldWithProducerReshapeByExpansion final : OpRewritePattern { FoldWithProducerReshapeByExpansion( MLIRContext *context, linalg::ControlFusionFn controlFoldingReshapes, PatternBenefit benefit = 1) @@ -879,7 +878,7 @@ struct FoldWithProducerReshapeByExpansion final template struct FoldWithConsumerReshapeByExpansion final - : public OpRewritePattern { + : OpRewritePattern { FoldWithConsumerReshapeByExpansion( MLIRContext *context, linalg::ControlFusionFn controlFoldingReshapes, PatternBenefit benefit = 1) @@ -1146,7 +1145,7 @@ SmallVector defaultControlDropUnitDims(Operation *op) { } struct DropAttentionUnitDims final - : public OpRewritePattern { + : OpRewritePattern { DropAttentionUnitDims(MLIRContext *context, linalg::ControlDropUnitDims options, PatternBenefit benefit = 1) diff --git a/compiler/src/iree/compiler/Dialect/LinalgExt/Transforms/TransposeFusion.cpp b/compiler/src/iree/compiler/Dialect/LinalgExt/Transforms/TransposeFusion.cpp index 6e2fcef64424..2969308ecc2d 100644 --- a/compiler/src/iree/compiler/Dialect/LinalgExt/Transforms/TransposeFusion.cpp +++ b/compiler/src/iree/compiler/Dialect/LinalgExt/Transforms/TransposeFusion.cpp @@ -21,7 +21,7 @@ namespace mlir::iree_compiler::IREE::LinalgExt { namespace { struct FuseTransposeWithAttentionOp final - : public OpRewritePattern { + : OpRewritePattern { FuseTransposeWithAttentionOp(MLIRContext *context, linalg::ControlFusionFn controlFn, PatternBenefit benefit = 1) @@ -80,7 +80,7 @@ struct FuseTransposeWithAttentionOp final // Bubbles transpose-V out of attention to expose the more performant // attention-transposeV. struct BubbleTransposeVFromAttentionOp - : public OpRewritePattern { + : OpRewritePattern { BubbleTransposeVFromAttentionOp(MLIRContext *context, linalg::ControlFusionFn controlFn, PatternBenefit benefit = 1) diff --git a/compiler/src/iree/compiler/Dialect/Stream/Conversion/FlowToStream/Patterns.cpp b/compiler/src/iree/compiler/Dialect/Stream/Conversion/FlowToStream/Patterns.cpp index fdd59515f490..88fbac58126b 100644 --- a/compiler/src/iree/compiler/Dialect/Stream/Conversion/FlowToStream/Patterns.cpp +++ b/compiler/src/iree/compiler/Dialect/Stream/Conversion/FlowToStream/Patterns.cpp @@ -45,7 +45,7 @@ static Value buildResultSizeOf(Location loc, Value tensorValue, } struct ConvertTensorConstantOp - : public AffinityOpConversionPattern { + : AffinityOpConversionPattern { public: using AffinityOpConversionPattern::AffinityOpConversionPattern; LogicalResult matchAndRewriteOnAffinity( @@ -77,7 +77,7 @@ struct ConvertTensorConstantOp }; struct ConvertTensorDynamicConstantOp - : public AffinityOpConversionPattern { + : AffinityOpConversionPattern { public: using AffinityOpConversionPattern::AffinityOpConversionPattern; LogicalResult matchAndRewriteOnAffinity( @@ -134,8 +134,7 @@ struct ConvertTensorDynamicConstantOp // as the clone may otherwise have been able to be elided on the producer // side but we leave that for future copy elision to determine. template -struct ConvertTensorCastLikeOp - : public AffinityAwareConversionPattern { +struct ConvertTensorCastLikeOp : AffinityAwareConversionPattern { using AffinityAwareConversionPattern< CastOpTy>::AffinityAwareConversionPattern; LogicalResult matchAndRewrite( @@ -161,7 +160,7 @@ struct ConvertTensorCastLikeOp }; struct ConvertTensorAllocaOp - : public AffinityOpConversionPattern { + : AffinityOpConversionPattern { using AffinityOpConversionPattern::AffinityOpConversionPattern; LogicalResult matchAndRewriteOnAffinity( IREE::Flow::TensorAllocaOp op, OneToNOpAdaptor adaptor, @@ -179,7 +178,7 @@ struct ConvertTensorAllocaOp }; struct ConvertTensorEmptyOp - : public AffinityOpConversionPattern { + : AffinityOpConversionPattern { using AffinityOpConversionPattern::AffinityOpConversionPattern; LogicalResult matchAndRewriteOnAffinity( IREE::Flow::TensorEmptyOp op, OneToNOpAdaptor adaptor, @@ -199,7 +198,7 @@ struct ConvertTensorEmptyOp }; struct ConvertTensorSplatOp - : public AffinityOpConversionPattern { + : AffinityOpConversionPattern { using AffinityOpConversionPattern::AffinityOpConversionPattern; LogicalResult matchAndRewriteOnAffinity( IREE::Flow::TensorSplatOp op, OneToNOpAdaptor adaptor, @@ -219,7 +218,7 @@ struct ConvertTensorSplatOp }; struct ConvertTensorCloneOp - : public AffinityOpConversionPattern { + : AffinityOpConversionPattern { using AffinityOpConversionPattern::AffinityOpConversionPattern; LogicalResult matchAndRewriteOnAffinity( IREE::Flow::TensorCloneOp op, OneToNOpAdaptor adaptor, @@ -240,7 +239,7 @@ struct ConvertTensorCloneOp }; struct ConvertTensorEncodeOp - : public AffinityOpConversionPattern { + : AffinityOpConversionPattern { using AffinityOpConversionPattern::AffinityOpConversionPattern; LogicalResult matchAndRewriteOnAffinity( IREE::Flow::TensorEncodeOp op, OneToNOpAdaptor adaptor, @@ -264,7 +263,7 @@ struct ConvertTensorEncodeOp }; struct ConvertTensorBarrierOp - : public AffinityOpConversionPattern { + : AffinityOpConversionPattern { using AffinityOpConversionPattern::AffinityOpConversionPattern; LogicalResult matchAndRewriteOnAffinity( IREE::Flow::TensorBarrierOp op, OneToNOpAdaptor adaptor, @@ -282,7 +281,7 @@ struct ConvertTensorBarrierOp }; struct ConvertTensorTransferOp - : public AffinityOpConversionPattern { + : AffinityOpConversionPattern { using AffinityOpConversionPattern::AffinityOpConversionPattern; LogicalResult matchAndRewriteOnAffinity( IREE::Flow::TensorTransferOp op, OneToNOpAdaptor adaptor, @@ -305,7 +304,7 @@ struct ConvertTensorTransferOp }; struct ConvertTensorSliceOp - : public AffinityOpConversionPattern { + : AffinityOpConversionPattern { using AffinityOpConversionPattern::AffinityOpConversionPattern; LogicalResult matchAndRewriteOnAffinity( IREE::Flow::TensorSliceOp op, OneToNOpAdaptor adaptor, @@ -331,7 +330,7 @@ struct ConvertTensorSliceOp }; struct ConvertTensorUpdateOp - : public AffinityOpConversionPattern { + : AffinityOpConversionPattern { using AffinityOpConversionPattern::AffinityOpConversionPattern; LogicalResult matchAndRewriteOnAffinity( IREE::Flow::TensorUpdateOp op, OneToNOpAdaptor adaptor, @@ -370,7 +369,7 @@ static bool isScalarTensor(RankedTensorType type) { } struct ConvertTensorLoadOp - : public AffinityAwareConversionPattern { + : AffinityAwareConversionPattern { using AffinityAwareConversionPattern::AffinityAwareConversionPattern; LogicalResult matchAndRewrite(IREE::Flow::TensorLoadOp op, OneToNOpAdaptor adaptor, @@ -450,7 +449,7 @@ struct ConvertTensorLoadOp }; struct ConvertTensorStoreOp - : public AffinityAwareConversionPattern { + : AffinityAwareConversionPattern { using AffinityAwareConversionPattern::AffinityAwareConversionPattern; LogicalResult matchAndRewrite(IREE::Flow::TensorStoreOp op, OneToNOpAdaptor adaptor, @@ -489,7 +488,7 @@ struct ConvertTensorStoreOp }; struct ConvertTensorTraceOp - : public AffinityAwareConversionPattern { + : AffinityAwareConversionPattern { using AffinityAwareConversionPattern::AffinityAwareConversionPattern; LogicalResult matchAndRewrite(IREE::Flow::TensorTraceOp op, OneToNOpAdaptor adaptor, @@ -524,7 +523,7 @@ struct ConvertTensorTraceOp }; struct ConvertParameterLoadOp - : public AffinityOpConversionPattern { + : AffinityOpConversionPattern { using AffinityOpConversionPattern::AffinityOpConversionPattern; LogicalResult matchAndRewriteOnAffinity( IREE::Flow::ParameterLoadOp op, OneToNOpAdaptor adaptor, @@ -548,7 +547,7 @@ struct ConvertParameterLoadOp }; struct ConvertParameterWriteOp - : public AffinityOpConversionPattern { + : AffinityOpConversionPattern { using AffinityOpConversionPattern::AffinityOpConversionPattern; LogicalResult matchAndRewriteOnAffinity( IREE::Flow::ParameterWriteOp op, OneToNOpAdaptor adaptor, @@ -573,7 +572,7 @@ struct ConvertParameterWriteOp }; struct ConvertChannelDefaultOp - : public AffinityOpConversionPattern { + : AffinityOpConversionPattern { using AffinityOpConversionPattern::AffinityOpConversionPattern; LogicalResult matchAndRewriteOnAffinity( IREE::Flow::ChannelDefaultOp op, OneToNOpAdaptor adaptor, @@ -589,8 +588,7 @@ struct ConvertChannelDefaultOp } }; -struct ConvertChannelSplitOp - : public OpConversionPattern { +struct ConvertChannelSplitOp : OpConversionPattern { using Base::Base; LogicalResult matchAndRewrite(IREE::Flow::ChannelSplitOp op, OpAdaptor adaptor, @@ -601,8 +599,7 @@ struct ConvertChannelSplitOp } }; -struct ConvertChannelRankOp - : public OpConversionPattern { +struct ConvertChannelRankOp : OpConversionPattern { using Base::Base; LogicalResult matchAndRewrite(IREE::Flow::ChannelRankOp op, OpAdaptor adaptor, @@ -613,8 +610,7 @@ struct ConvertChannelRankOp } }; -struct ConvertChannelCountOp - : public OpConversionPattern { +struct ConvertChannelCountOp : OpConversionPattern { using Base::Base; LogicalResult matchAndRewrite(IREE::Flow::ChannelCountOp op, OpAdaptor adaptor, @@ -626,7 +622,7 @@ struct ConvertChannelCountOp }; struct ConvertAllGatherOp - : public AffinityOpConversionPattern { + : AffinityOpConversionPattern { using AffinityOpConversionPattern::AffinityOpConversionPattern; LogicalResult matchAndRewriteOnAffinity( IREE::Flow::CollectiveAllGatherOp op, OneToNOpAdaptor adaptor, @@ -669,7 +665,7 @@ struct ConvertAllGatherOp }; struct ConvertAllReduceOp - : public AffinityOpConversionPattern { + : AffinityOpConversionPattern { using AffinityOpConversionPattern::AffinityOpConversionPattern; LogicalResult matchAndRewriteOnAffinity( IREE::Flow::CollectiveAllReduceOp op, OneToNOpAdaptor adaptor, @@ -712,7 +708,7 @@ struct ConvertAllReduceOp }; struct ConvertAllToAllOp - : public AffinityOpConversionPattern { + : AffinityOpConversionPattern { using AffinityOpConversionPattern::AffinityOpConversionPattern; LogicalResult matchAndRewriteOnAffinity( IREE::Flow::CollectiveAllToAllOp op, OneToNOpAdaptor adaptor, @@ -754,8 +750,8 @@ struct ConvertAllToAllOp } }; -struct ConvertReduceScatterOp : public AffinityOpConversionPattern< - IREE::Flow::CollectiveReduceScatterOp> { +struct ConvertReduceScatterOp + : AffinityOpConversionPattern { using AffinityOpConversionPattern::AffinityOpConversionPattern; LogicalResult matchAndRewriteOnAffinity( IREE::Flow::CollectiveReduceScatterOp op, OneToNOpAdaptor adaptor, @@ -798,7 +794,7 @@ struct ConvertReduceScatterOp : public AffinityOpConversionPattern< }; struct ConvertCollectiveSendRecvOp - : public AffinityOpConversionPattern { + : AffinityOpConversionPattern { using AffinityOpConversionPattern::AffinityOpConversionPattern; LogicalResult matchAndRewriteOnAffinity( IREE::Flow::CollectiveSendRecvOp op, OneToNOpAdaptor adaptor, @@ -854,8 +850,7 @@ struct ConvertCollectiveSendRecvOp } }; -struct ConvertDispatchOp - : public AffinityOpConversionPattern { +struct ConvertDispatchOp : AffinityOpConversionPattern { using AffinityOpConversionPattern::AffinityOpConversionPattern; LogicalResult matchAndRewriteOnAffinity( IREE::Flow::DispatchOp op, OneToNOpAdaptor adaptor, @@ -937,7 +932,7 @@ struct ConvertDispatchOp } }; -struct ConvertFuncOp : public OpConversionPattern { +struct ConvertFuncOp : OpConversionPattern { using Base::Base; LogicalResult matchAndRewrite(IREE::Flow::FuncOp op, OpAdaptor adaptor, @@ -972,7 +967,7 @@ struct ConvertFuncOp : public OpConversionPattern { } }; -struct ConvertCallOp : public AffinityOpConversionPattern { +struct ConvertCallOp : AffinityOpConversionPattern { using AffinityOpConversionPattern::AffinityOpConversionPattern; LogicalResult matchAndRewriteOnAffinity( IREE::Flow::CallOp op, OneToNOpAdaptor adaptor, @@ -1132,7 +1127,7 @@ static void replaceDispatchWorkgroupInfoOp(FlowOpT op, } template -struct ConvertDispatchWorkgroupInfoOp : public OpConversionPattern { +struct ConvertDispatchWorkgroupInfoOp : OpConversionPattern { using OpConversionPattern::OpConversionPattern; LogicalResult matchAndRewrite(FlowOpT op, typename FlowOpT::Adaptor adaptor, @@ -1143,8 +1138,7 @@ struct ConvertDispatchWorkgroupInfoOp : public OpConversionPattern { } }; -struct ConvertExecutableOp - : public OpConversionPattern { +struct ConvertExecutableOp : OpConversionPattern { using Base::Base; LogicalResult matchAndRewrite(IREE::Flow::ExecutableOp flowOp, OpAdaptor adaptor, @@ -1249,7 +1243,7 @@ struct ConvertExecutableOp } }; -struct ConvertReturnOp : public OpConversionPattern { +struct ConvertReturnOp : OpConversionPattern { using Base::Base; LogicalResult matchAndRewrite(IREE::Flow::ReturnOp op, OpAdaptor adaptor, diff --git a/compiler/src/iree/compiler/Dialect/Stream/Conversion/HALToStream/Patterns.cpp b/compiler/src/iree/compiler/Dialect/Stream/Conversion/HALToStream/Patterns.cpp index 1bb8c5ecc6bd..10cc9c4fd5dc 100644 --- a/compiler/src/iree/compiler/Dialect/Stream/Conversion/HALToStream/Patterns.cpp +++ b/compiler/src/iree/compiler/Dialect/Stream/Conversion/HALToStream/Patterns.cpp @@ -31,7 +31,7 @@ static SmallVector flattenValues(ArrayRef values) { // %1 = stream.tensor.import %0 : !hal.buffer_view -> // tensor<4xf32> in !stream.resource<*> struct ConvertTensorImportOp - : public AffinityOpConversionPattern { + : AffinityOpConversionPattern { using AffinityOpConversionPattern::AffinityOpConversionPattern; LogicalResult matchAndRewriteOnAffinity( IREE::HAL::TensorImportOp op, OneToNOpAdaptor adaptor, @@ -142,7 +142,7 @@ struct ConvertTensorImportOp // %1 = stream.tensor.export %0 : tensor<4xf32> in !stream.resource<*> -> // !hal.buffer_view struct ConvertTensorExportOp - : public AffinityOpConversionPattern { + : AffinityOpConversionPattern { using AffinityOpConversionPattern::AffinityOpConversionPattern; LogicalResult matchAndRewriteOnAffinity( IREE::HAL::TensorExportOp op, OneToNOpAdaptor adaptor, @@ -193,7 +193,7 @@ struct ConvertTensorExportOp // %update = stream.async.update %0, %storage[...] // %2 = stream.async.slice %update[...] struct ConvertTensorAliasOp - : public AffinityOpConversionPattern { + : AffinityOpConversionPattern { using AffinityOpConversionPattern::AffinityOpConversionPattern; LogicalResult matchAndRewriteOnAffinity( IREE::HAL::TensorAliasOp op, OneToNOpAdaptor adaptor, @@ -283,7 +283,7 @@ struct ConvertTensorAliasOp // => !stream.timepoint // %1 = stream.timepoint.await %t1 => %1a : !stream.resource<*>{%size} struct ConvertTensorTransientsOp - : public AffinityOpConversionPattern { + : AffinityOpConversionPattern { using AffinityOpConversionPattern::AffinityOpConversionPattern; LogicalResult matchAndRewriteOnAffinity( IREE::HAL::TensorTransientsOp op, OneToNOpAdaptor adaptor, @@ -352,7 +352,7 @@ struct ConvertTensorTransientsOp // %t01 = stream.timepoint.join max(%t0, %t1) // stream.timepoint.export %t01 => %fence struct ConvertTensorBarrierOp - : public AffinityAwareConversionPattern { + : AffinityAwareConversionPattern { using AffinityAwareConversionPattern::AffinityAwareConversionPattern; LogicalResult matchAndRewrite(IREE::HAL::TensorBarrierOp op, OneToNOpAdaptor adaptor, diff --git a/compiler/src/iree/compiler/Dialect/Stream/Conversion/PatternUtils.h b/compiler/src/iree/compiler/Dialect/Stream/Conversion/PatternUtils.h index 774b7f65b9d2..a12fc6c65cf2 100644 --- a/compiler/src/iree/compiler/Dialect/Stream/Conversion/PatternUtils.h +++ b/compiler/src/iree/compiler/Dialect/Stream/Conversion/PatternUtils.h @@ -51,7 +51,7 @@ ConvertedTensor transferTensorOperands( IREE::Stream::AffinityAnalysis *affinityAnalysis, OpBuilder &builder); template -struct AffinityAwareConversionPattern : public OpConversionPattern { +struct AffinityAwareConversionPattern : OpConversionPattern { public: AffinityAwareConversionPattern( const TypeConverter &typeConverter, MLIRContext *context, @@ -91,8 +91,7 @@ struct AffinityAwareConversionPattern : public OpConversionPattern { }; template -struct AffinityOpConversionPattern - : public AffinityAwareConversionPattern { +struct AffinityOpConversionPattern : AffinityAwareConversionPattern { public: AffinityOpConversionPattern(const TypeConverter &typeConverter, MLIRContext *context, diff --git a/compiler/src/iree/compiler/Dialect/Stream/Conversion/StandardToStream/Patterns.cpp b/compiler/src/iree/compiler/Dialect/Stream/Conversion/StandardToStream/Patterns.cpp index 30bc7b56be7d..690913f48150 100644 --- a/compiler/src/iree/compiler/Dialect/Stream/Conversion/StandardToStream/Patterns.cpp +++ b/compiler/src/iree/compiler/Dialect/Stream/Conversion/StandardToStream/Patterns.cpp @@ -40,7 +40,7 @@ static SmallVector flattenValues(ArrayRef values) { } struct ConvertTensorConstantOp - : public AffinityOpConversionPattern { + : AffinityOpConversionPattern { using AffinityOpConversionPattern::AffinityOpConversionPattern; LogicalResult matchAndRewriteOnAffinity( arith::ConstantOp constantOp, OneToNOpAdaptor adaptor, @@ -74,8 +74,7 @@ struct ConvertTensorConstantOp } }; -struct BranchOpConversion - : public AffinityAwareConversionPattern { +struct BranchOpConversion : AffinityAwareConversionPattern { using AffinityAwareConversionPattern::AffinityAwareConversionPattern; LogicalResult matchAndRewrite(mlir::cf::BranchOp op, OneToNOpAdaptor adaptor, @@ -88,7 +87,7 @@ struct BranchOpConversion }; struct CondBranchOpConversion - : public AffinityAwareConversionPattern { + : AffinityAwareConversionPattern { using AffinityAwareConversionPattern::AffinityAwareConversionPattern; LogicalResult matchAndRewrite(mlir::cf::CondBranchOp op, OneToNOpAdaptor adaptor, @@ -105,8 +104,7 @@ struct CondBranchOpConversion static ValueRange asValueRange(ArrayRef values) { return values; } -struct SwitchOpConversion - : public AffinityAwareConversionPattern { +struct SwitchOpConversion : AffinityAwareConversionPattern { using AffinityAwareConversionPattern::AffinityAwareConversionPattern; LogicalResult matchAndRewrite(mlir::cf::SwitchOp op, OneToNOpAdaptor adaptor, @@ -125,7 +123,7 @@ struct SwitchOpConversion }; struct SelectOpConversion - : public AffinityAwareConversionPattern { + : AffinityAwareConversionPattern { using AffinityAwareConversionPattern::AffinityAwareConversionPattern; LogicalResult matchAndRewrite(mlir::arith::SelectOp op, OneToNOpAdaptor adaptor, @@ -150,8 +148,7 @@ struct SelectOpConversion } }; -struct ScfIfOpConversion - : public AffinityAwareConversionPattern { +struct ScfIfOpConversion : AffinityAwareConversionPattern { using AffinityAwareConversionPattern::AffinityAwareConversionPattern; LogicalResult matchAndRewrite(mlir::scf::IfOp op, OpAdaptor adaptor, @@ -210,8 +207,7 @@ struct ScfIfOpConversion } }; -struct ScfForOpConversion - : public AffinityAwareConversionPattern { +struct ScfForOpConversion : AffinityAwareConversionPattern { using AffinityAwareConversionPattern::AffinityAwareConversionPattern; LogicalResult matchAndRewrite(mlir::scf::ForOp op, OneToNOpAdaptor adaptor, @@ -288,7 +284,7 @@ struct ScfForOpConversion }; struct ScfWhileOpConversion - : public AffinityAwareConversionPattern { + : AffinityAwareConversionPattern { using AffinityAwareConversionPattern::AffinityAwareConversionPattern; LogicalResult matchAndRewrite(mlir::scf::WhileOp op, OneToNOpAdaptor adaptor, @@ -371,7 +367,7 @@ struct ScfWhileOpConversion }; struct ScfConditionOpConversion - : public AffinityAwareConversionPattern { + : AffinityAwareConversionPattern { using AffinityAwareConversionPattern::AffinityAwareConversionPattern; LogicalResult matchAndRewrite(mlir::scf::ConditionOp op, OneToNOpAdaptor adaptor, @@ -385,7 +381,7 @@ struct ScfConditionOpConversion }; struct ScfYieldOpConversion - : public AffinityAwareConversionPattern { + : AffinityAwareConversionPattern { using AffinityAwareConversionPattern::AffinityAwareConversionPattern; LogicalResult matchAndRewrite(mlir::scf::YieldOp op, OneToNOpAdaptor adaptor, diff --git a/compiler/src/iree/compiler/Dialect/Stream/Conversion/UtilToStream/Patterns.cpp b/compiler/src/iree/compiler/Dialect/Stream/Conversion/UtilToStream/Patterns.cpp index 58bc0c85e097..00d8e287901a 100644 --- a/compiler/src/iree/compiler/Dialect/Stream/Conversion/UtilToStream/Patterns.cpp +++ b/compiler/src/iree/compiler/Dialect/Stream/Conversion/UtilToStream/Patterns.cpp @@ -32,8 +32,7 @@ static SmallVector flattenValues(ArrayRef values) { // Structural ops //===----------------------------------------------------------------------===// -struct FuncOpSignatureConversion - : public OpConversionPattern { +struct FuncOpSignatureConversion : OpConversionPattern { using Base::Base; LogicalResult matchAndRewrite(IREE::Util::FuncOp funcOp, OpAdaptor adaptor, @@ -76,8 +75,7 @@ struct FuncOpSignatureConversion } }; -struct CallOpConversion - : public AffinityAwareConversionPattern { +struct CallOpConversion : AffinityAwareConversionPattern { using AffinityAwareConversionPattern::AffinityAwareConversionPattern; LogicalResult matchAndRewrite(IREE::Util::CallOp op, OneToNOpAdaptor adaptor, @@ -132,7 +130,7 @@ struct CallOpConversion }; struct ReturnOpConversion - : public AffinityAwareConversionPattern { + : AffinityAwareConversionPattern { using AffinityAwareConversionPattern::AffinityAwareConversionPattern; LogicalResult matchAndRewrite(IREE::Util::ReturnOp op, OneToNOpAdaptor adaptor, @@ -186,8 +184,7 @@ class BaseGlobalConversionPattern : public OpConversionPattern { IREE::Stream::AffinityAnalysis *affinityAnalysis; }; -struct GlobalOpExpansion - : public BaseGlobalConversionPattern { +struct GlobalOpExpansion : BaseGlobalConversionPattern { using BaseGlobalConversionPattern::BaseGlobalConversionPattern; LogicalResult matchAndRewrite(IREE::Util::GlobalOp globalOp, OpAdaptor adaptor, @@ -295,7 +292,7 @@ struct GlobalOpExpansion }; struct GlobalLoadOpExpansion - : public BaseGlobalConversionPattern { + : BaseGlobalConversionPattern { using BaseGlobalConversionPattern::BaseGlobalConversionPattern; LogicalResult matchAndRewrite(IREE::Util::GlobalLoadOp loadOp, OpAdaptor adaptor, @@ -336,7 +333,7 @@ struct GlobalLoadOpExpansion }; struct GlobalStoreOpExpansion - : public BaseGlobalConversionPattern { + : BaseGlobalConversionPattern { using BaseGlobalConversionPattern::BaseGlobalConversionPattern; LogicalResult matchAndRewrite(IREE::Util::GlobalStoreOp storeOp, OneToNOpAdaptor adaptor, @@ -377,7 +374,7 @@ struct GlobalStoreOpExpansion }; struct OptimizationBarrierOpConversion - : public AffinityAwareConversionPattern { + : AffinityAwareConversionPattern { using AffinityAwareConversionPattern::AffinityAwareConversionPattern; LogicalResult matchAndRewrite(IREE::Util::OptimizationBarrierOp op, OneToNOpAdaptor adaptor, diff --git a/compiler/src/iree/compiler/Dialect/Stream/IR/StreamDialect.cpp b/compiler/src/iree/compiler/Dialect/Stream/IR/StreamDialect.cpp index 6424b8fa9ceb..dedaa0e503bd 100644 --- a/compiler/src/iree/compiler/Dialect/Stream/IR/StreamDialect.cpp +++ b/compiler/src/iree/compiler/Dialect/Stream/IR/StreamDialect.cpp @@ -26,7 +26,7 @@ namespace mlir::iree_compiler::IREE::Stream { namespace { // Used to control inlining behavior. -struct StreamInlinerInterface : public DialectInlinerInterface { +struct StreamInlinerInterface : DialectInlinerInterface { using DialectInlinerInterface::DialectInlinerInterface; bool isLegalToInline(Operation *call, Operation *callable, @@ -47,7 +47,7 @@ struct StreamInlinerInterface : public DialectInlinerInterface { } }; -struct StreamFolderInterface : public DialectFoldInterface { +struct StreamFolderInterface : DialectFoldInterface { using DialectFoldInterface::DialectFoldInterface; bool shouldMaterializeInto(Region *region) const override { @@ -64,7 +64,7 @@ struct StreamFolderInterface : public DialectFoldInterface { // %0 = builtin.unrealized_conversion_cast %arg0, %arg1 : // !stream.resource, index to !stream.resource struct StripResourceConversionCastPattern - : public OpRewritePattern { + : OpRewritePattern { using Base::Base; LogicalResult matchAndRewrite(UnrealizedConversionCastOp castOp, PatternRewriter &rewriter) const override { diff --git a/compiler/src/iree/compiler/Dialect/Stream/IR/StreamOpFolders.cpp b/compiler/src/iree/compiler/Dialect/Stream/IR/StreamOpFolders.cpp index 66d0cfb54005..9bc9d0655d44 100644 --- a/compiler/src/iree/compiler/Dialect/Stream/IR/StreamOpFolders.cpp +++ b/compiler/src/iree/compiler/Dialect/Stream/IR/StreamOpFolders.cpp @@ -156,7 +156,7 @@ static TypedAttr tryNarrowPatternBits(TypedAttr patternAttr) { // Tries to narrow constant splat/fill patterns to a smaller bit width. template -struct NarrowFillPattern : public OpRewritePattern { +struct NarrowFillPattern : OpRewritePattern { using OpRewritePattern::OpRewritePattern; LogicalResult matchAndRewrite(Op fillOp, PatternRewriter &rewriter) const override { @@ -326,7 +326,7 @@ static void setInsertionPointToParentExecutionScope(Operation *op, // This is to support ops that are "pure" but can't be marked as such because // the MLIR CSE pass would deduplicate them. template -struct ElideUnusedOp : public OpRewritePattern { +struct ElideUnusedOp : OpRewritePattern { explicit ElideUnusedOp(MLIRContext *context) : OpRewritePattern(context, /*benefit=*/1000) {} LogicalResult matchAndRewrite(Op op, @@ -349,7 +349,7 @@ struct ElideUnusedOp : public OpRewritePattern { // -> // %1 = stream.async.splat %c123_i32 template -struct PropagateCloneableOps : public OpRewritePattern { +struct PropagateCloneableOps : OpRewritePattern { using OpRewritePattern::OpRewritePattern; LogicalResult matchAndRewrite(Op cloneOp, PatternRewriter &rewriter) const override { @@ -394,7 +394,7 @@ struct PropagateCloneableOps : public OpRewritePattern { // stream.yield %2 // } template -struct TieRegionResults : public OpRewritePattern { +struct TieRegionResults : OpRewritePattern { using OpRewritePattern::OpRewritePattern; LogicalResult matchAndRewrite(Op op, PatternRewriter &rewriter) const override { @@ -453,7 +453,7 @@ static Value joinAwaitTimepoints(Location loc, Value existingTimepoint, // -> // %1 = stream.resource.alloca ... template -struct ElideImmediateTimepointWait : public OpRewritePattern { +struct ElideImmediateTimepointWait : OpRewritePattern { using OpRewritePattern::OpRewritePattern; LogicalResult matchAndRewrite(Op op, PatternRewriter &rewriter) const override { @@ -480,7 +480,7 @@ struct ElideImmediateTimepointWait : public OpRewritePattern { // %0 = stream.cmd.execute with(%resource) // %2 = stream.cmd.execute await(%0) => with(%resource) template -struct ChainDependentAwaits : public OpRewritePattern { +struct ChainDependentAwaits : OpRewritePattern { using OpRewritePattern::OpRewritePattern; LogicalResult matchAndRewrite(Op op, PatternRewriter &rewriter) const override { @@ -533,7 +533,7 @@ namespace { // DCEd by other patterns or passes. The ElideAllocaDeallocaOp pattern will be // used after deallocations have been inserted but prior to that point this // pattern allows for more eager removal of unused allocations. -struct ElideUnusedAllocaOp : public OpRewritePattern { +struct ElideUnusedAllocaOp : OpRewritePattern { using Base::Base; LogicalResult matchAndRewrite(ResourceAllocaOp allocaOp, PatternRewriter &rewriter) const override { @@ -558,7 +558,7 @@ struct ElideUnusedAllocaOp : public OpRewritePattern { // Example: // %resource, %alloca_t = stream.resource.alloca // %dealloca_t = stream.resource.dealloca await(%alloca_t) %resource -struct ElideAllocaDeallocaOp : public OpRewritePattern { +struct ElideAllocaDeallocaOp : OpRewritePattern { using Base::Base; LogicalResult matchAndRewrite(ResourceAllocaOp allocaOp, PatternRewriter &rewriter) const override { @@ -618,7 +618,7 @@ struct ElideAllocaDeallocaOp : public OpRewritePattern { // %j = join %d0, %d1, %d2, %d3 // ... await(%j) template -struct BatchAllocaOps : public OpRewritePattern { +struct BatchAllocaOps : OpRewritePattern { using OpRewritePattern::OpRewritePattern; LogicalResult matchAndRewrite(OpT op, PatternRewriter &rewriter) const override { @@ -722,7 +722,7 @@ namespace { // -> // %c = select %cond, %a, %b : !stream.resource<*> // %c_sz = select %cond, %a_sz, %b_sz : index -struct SelectResourceSizeOp : public OpRewritePattern { +struct SelectResourceSizeOp : OpRewritePattern { using Base::Base; LogicalResult matchAndRewrite(ResourceSizeOp op, PatternRewriter &rewriter) const override { @@ -772,7 +772,7 @@ namespace { // -> // %new_offset = arith.addi %offset, %subview_offset // %1 = stream.resource.load %src[%new_offset] -struct FoldSubviewIntoLoadOp : public OpRewritePattern { +struct FoldSubviewIntoLoadOp : OpRewritePattern { using Base::Base; LogicalResult matchAndRewrite(ResourceLoadOp op, PatternRewriter &rewriter) const override { @@ -818,7 +818,7 @@ namespace { // -> // %new_offset = arith.addi %offset, %subview_offset // stream.resource.store %c123_i32, %dst[%new_offset] -struct FoldSubviewIntoStoreOp : public OpRewritePattern { +struct FoldSubviewIntoStoreOp : OpRewritePattern { using Base::Base; LogicalResult matchAndRewrite(ResourceStoreOp op, PatternRewriter &rewriter) const override { @@ -884,8 +884,7 @@ namespace { // This allows for better folding of the results after packing has completed. // The offset value is just a convenience for when splitting pack ops and has // no impact on the actual packing operation. -struct PropagateResourcePackBaseOffset - : public OpRewritePattern { +struct PropagateResourcePackBaseOffset : OpRewritePattern { using Base::Base; LogicalResult matchAndRewrite(ResourcePackOp op, PatternRewriter &rewriter) const override { @@ -933,8 +932,7 @@ struct PropagateResourcePackBaseOffset // [0, 4] = %size, // [1, 2] = %size, // }) : index -struct CanonicalizeResourcePackIntervals - : public OpRewritePattern { +struct CanonicalizeResourcePackIntervals : OpRewritePattern { using Base::Base; LogicalResult matchAndRewrite(ResourcePackOp op, PatternRewriter &rewriter) const override { @@ -1008,7 +1006,7 @@ namespace { // Folds subview -> subview to point at the original source resource with an // updated range. -struct FoldResourceSubviewOps : public OpRewritePattern { +struct FoldResourceSubviewOps : OpRewritePattern { using Base::Base; LogicalResult matchAndRewrite(ResourceSubviewOp op, PatternRewriter &rewriter) const override { @@ -1037,8 +1035,7 @@ struct FoldResourceSubviewOps : public OpRewritePattern { // -> // %offset = select %cond, %offset0, %offset1 : index // %subview = stream.resource.subview %src[%offset] -struct SinkSubviewAcrossSelectOps - : public OpRewritePattern { +struct SinkSubviewAcrossSelectOps : OpRewritePattern { using Base::Base; LogicalResult matchAndRewrite(mlir::arith::SelectOp op, PatternRewriter &rewriter) const override { @@ -1152,7 +1149,7 @@ void TensorExportOp::getCanonicalizationPatterns(RewritePatternSet &results, namespace { -struct TensorConstantToEmpty : public OpRewritePattern { +struct TensorConstantToEmpty : OpRewritePattern { using Base::Base; LogicalResult matchAndRewrite(TensorConstantOp constantOp, PatternRewriter &rewriter) const override { @@ -1196,7 +1193,7 @@ struct TensorConstantToEmpty : public OpRewritePattern { } }; -struct TensorConstantToSplat : public OpRewritePattern { +struct TensorConstantToSplat : OpRewritePattern { using Base::Base; LogicalResult matchAndRewrite(TensorConstantOp constantOp, PatternRewriter &rewriter) const override { @@ -1272,7 +1269,7 @@ OpFoldResult TensorCloneOp::fold(FoldAdaptor) { namespace { // Elides clones that don't do anything meaningful (like setting up a tie). -struct ElideUnneededTensorClones : public OpRewritePattern { +struct ElideUnneededTensorClones : OpRewritePattern { using Base::Base; LogicalResult matchAndRewrite(TensorCloneOp cloneOp, PatternRewriter &rewriter) const override { @@ -1402,7 +1399,7 @@ void TensorStoreOp::getCanonicalizationPatterns(RewritePatternSet &results, namespace { struct DeduplicateTensorDispatchEntryRefs final - : public OpRewritePattern { + : OpRewritePattern { using Base::Base; LogicalResult matchAndRewrite(TensorDispatchOp dispatchOp, PatternRewriter &rewriter) const override { @@ -1435,7 +1432,7 @@ namespace { // Sinks transient alloca-like ops down to their consumers to avoid cases where // we allocate and then keep that live/copy-on-write it when not required. template -struct SinkAllocaLikeOpToConsumers : public OpRewritePattern { +struct SinkAllocaLikeOpToConsumers : OpRewritePattern { using OpRewritePattern::OpRewritePattern; LogicalResult matchAndRewrite(Op producerOp, PatternRewriter &rewriter) const override { @@ -1512,8 +1509,7 @@ void AsyncAllocaOp::getCanonicalizationPatterns(RewritePatternSet &results, namespace { // Converts constants with splat values into splats. -struct ConvertSplatConstantsIntoSplats - : public OpRewritePattern { +struct ConvertSplatConstantsIntoSplats : OpRewritePattern { using Base::Base; LogicalResult matchAndRewrite(AsyncConstantOp constantOp, PatternRewriter &rewriter) const override { @@ -1597,7 +1593,7 @@ namespace { // %1 = stream.async.slice %0[%c0 to %c128] ... {%c128} // -> // %1 = stream.async.splat %c123_i32 : i32 -> !stream.resource<*>{%c128} -struct PropagateSplatsThroughSlices : public OpRewritePattern { +struct PropagateSplatsThroughSlices : OpRewritePattern { using Base::Base; LogicalResult matchAndRewrite(AsyncSliceOp sliceOp, PatternRewriter &rewriter) const override { @@ -1639,7 +1635,7 @@ namespace { // %0 = stream.async.fill %cst, %dst[%c0 to %dstsz for %dstsz] ... {%dstsz} // -> // %0 = stream.async.splat %cst : f32 -> !stream.resource<*>{%dstsz} -struct FlattenFullFillToSplat : public OpRewritePattern { +struct FlattenFullFillToSplat : OpRewritePattern { using Base::Base; LogicalResult matchAndRewrite(AsyncFillOp fillOp, PatternRewriter &rewriter) const override { @@ -1670,7 +1666,7 @@ struct FlattenFullFillToSplat : public OpRewritePattern { // Example: // %0 = stream.async.splat %c123 // %1 = stream.async.fill %c123, %0[...] -struct ElideRedundantFill : public OpRewritePattern { +struct ElideRedundantFill : OpRewritePattern { using Base::Base; LogicalResult matchAndRewrite(AsyncFillOp fillOp, PatternRewriter &rewriter) const override { @@ -1702,7 +1698,7 @@ struct ElideRedundantFill : public OpRewritePattern { // %1 = stream.async.fill %c123, %0[%b to %c for %l1] // -> // %0 = stream.async.fill %c123, %...[%a to %c for %l0plus1] -struct CoalesceAdjacentFills : public OpRewritePattern { +struct CoalesceAdjacentFills : OpRewritePattern { using Base::Base; LogicalResult matchAndRewrite(AsyncFillOp fillOp, PatternRewriter &rewriter) const override { @@ -1834,7 +1830,7 @@ namespace { // %2 = stream.async.update %1, %0[full] // -> // %2 = stream.async.dispatch .... %0 -> %0 -struct ElideInPlaceUpdate : public OpRewritePattern { +struct ElideInPlaceUpdate : OpRewritePattern { using Base::Base; LogicalResult matchAndRewrite(AsyncUpdateOp updateOp, PatternRewriter &rewriter) const override { @@ -1922,7 +1918,7 @@ struct ElideInPlaceUpdate : public OpRewritePattern { // %1 = stream.async.update %0, %dst[%c0 to %c128] // -> // %1 = stream.async.fill %c123_i32, %dst[%c0 to %c128 for %c128] -struct CombineSplatUpdateFromToFill : public OpRewritePattern { +struct CombineSplatUpdateFromToFill : OpRewritePattern { using Base::Base; LogicalResult matchAndRewrite(AsyncUpdateOp updateOp, PatternRewriter &rewriter) const override { @@ -1957,7 +1953,7 @@ struct CombineSplatUpdateFromToFill : public OpRewritePattern { // TODO(benvanik): evaluate if we want to do this in all cases - we may only // want if it there are users of the source after this op such that we wouldn't // be the op keeping the entire unsliced source resource live. -struct CombineSliceUpdateFromToCopy : public OpRewritePattern { +struct CombineSliceUpdateFromToCopy : OpRewritePattern { using Base::Base; LogicalResult matchAndRewrite(AsyncUpdateOp updateOp, PatternRewriter &rewriter) const override { @@ -2007,7 +2003,7 @@ namespace { // %2 = stream.async.copy %0[%c0 to %sz0], %1[%c0 to %sz1], %sz0 // -> // %2 = stream.async.update %0, %1[%c0 to %sz1] -struct AsyncCopyFullSourceToUpdate : public OpRewritePattern { +struct AsyncCopyFullSourceToUpdate : OpRewritePattern { using Base::Base; LogicalResult matchAndRewrite(AsyncCopyOp copyOp, PatternRewriter &rewriter) const override { @@ -2069,7 +2065,7 @@ namespace { // clones represent copy-on-write operations on the same device. When a transfer // has the same source and target affinity (or both are implicit) it's actually // a clone operation that may also change the lifetime. -struct SameAffinityTransferToClone : public OpRewritePattern { +struct SameAffinityTransferToClone : OpRewritePattern { using Base::Base; LogicalResult matchAndRewrite(AsyncTransferOp transferOp, PatternRewriter &rewriter) const override { @@ -2103,7 +2099,7 @@ struct SameAffinityTransferToClone : public OpRewritePattern { }; // Collapses chains of transfers that have no use. -struct IntermediateTransferElision : public OpRewritePattern { +struct IntermediateTransferElision : OpRewritePattern { using Base::Base; LogicalResult matchAndRewrite(AsyncTransferOp transferOp, PatternRewriter &rewriter) const override { @@ -2148,7 +2144,7 @@ namespace { // Folds subsequent bitcasts into the load op. The bit width will be the same // and it avoids additional conversion. -struct FoldAsyncLoadBitcast : public OpRewritePattern { +struct FoldAsyncLoadBitcast : OpRewritePattern { using Base::Base; LogicalResult matchAndRewrite(AsyncLoadOp loadOp, PatternRewriter &rewriter) const override { @@ -2188,7 +2184,7 @@ namespace { // Folds preceding bitcasts into the store op. The bit width will be the same // and it avoids additional conversion. -struct FoldAsyncStoreBitcast : public OpRewritePattern { +struct FoldAsyncStoreBitcast : OpRewritePattern { using Base::Base; LogicalResult matchAndRewrite(AsyncStoreOp storeOp, PatternRewriter &rewriter) const override { @@ -2220,7 +2216,7 @@ void AsyncStoreOp::getCanonicalizationPatterns(RewritePatternSet &results, namespace { struct DeduplicateAsyncDispatchEntryRefs final - : public OpRewritePattern { + : OpRewritePattern { using Base::Base; LogicalResult matchAndRewrite(AsyncDispatchOp dispatchOp, PatternRewriter &rewriter) const override { @@ -2263,8 +2259,7 @@ namespace { // If any operands are sourced from subviews clone those subviews into the // region and rewrite the operands to point at the original resource. This // allows us to progressively fold the subviews into the ops consuming them. -struct CloneCapturedAsyncExecuteSubviewOps - : public OpRewritePattern { +struct CloneCapturedAsyncExecuteSubviewOps : OpRewritePattern { using Base::Base; LogicalResult matchAndRewrite(AsyncExecuteOp op, PatternRewriter &rewriter) const override { @@ -2323,7 +2318,7 @@ struct CloneCapturedAsyncExecuteSubviewOps // -> // %result = %capture // %timepoint = stream.timepoint.immediate -struct ElideNoOpAsyncExecuteOp : public OpRewritePattern { +struct ElideNoOpAsyncExecuteOp : OpRewritePattern { using Base::Base; LogicalResult matchAndRewrite(AsyncExecuteOp op, PatternRewriter &rewriter) const override { @@ -2451,7 +2446,7 @@ findConsumerThroughAwait(Value timelineResult) { // %loaded = stream.async.parameter.load "scope"::"key"[%new_offset] // : !stream.resource{%view_size} struct FoldAsyncParameterLoadResultSubview - : public OpRewritePattern { + : OpRewritePattern { using Base::Base; LogicalResult matchAndRewrite(AsyncParameterLoadOp op, PatternRewriter &rewriter) const override { @@ -2509,7 +2504,7 @@ struct FoldAsyncParameterLoadResultSubview // %loaded = stream.async.parameter.load "scope"::"key"[%new_offset] // : !stream.resource{%slice_size} struct FoldAsyncParameterLoadResultSlice - : public OpRewritePattern { + : OpRewritePattern { using Base::Base; LogicalResult matchAndRewrite(AsyncParameterLoadOp op, PatternRewriter &rewriter) const override { @@ -2582,7 +2577,7 @@ namespace { // %result = stream.async.parameter.read "scope"::"key"[%new_param_offset] // -> %target[%new_target_offset for %length] : ... struct FoldAsyncParameterReadTargetSubview - : public OpRewritePattern { + : OpRewritePattern { using Base::Base; LogicalResult matchAndRewrite(AsyncParameterReadOp op, PatternRewriter &rewriter) const override { @@ -2654,7 +2649,7 @@ namespace { // %source[%new_source_offset for %length] // -> "scope"::"key"[%new_param_offset] : ... struct FoldAsyncParameterWriteSourceSubview - : public OpRewritePattern { + : OpRewritePattern { using Base::Base; LogicalResult matchAndRewrite(AsyncParameterWriteOp op, PatternRewriter &rewriter) const override { @@ -2734,7 +2729,7 @@ namespace { // -> %target[%new_target_offset1 for %length1] // } : ... struct FoldAsyncParameterGatherTargetSubview - : public OpRewritePattern { + : OpRewritePattern { using Base::Base; LogicalResult matchAndRewrite(AsyncParameterGatherOp op, PatternRewriter &rewriter) const override { @@ -2827,7 +2822,7 @@ namespace { // -> "scope"::"key1"[%new_param_offset1] // } : ... struct FoldAsyncParameterScatterSourceSubview - : public OpRewritePattern { + : OpRewritePattern { using Base::Base; LogicalResult matchAndRewrite(AsyncParameterScatterOp op, PatternRewriter &rewriter) const override { @@ -2905,7 +2900,7 @@ namespace { // -> // %new_offset = arith.addi %offset, %subview_offset // stream.cmd.flush %dst[%new_offset for %subview_length] -struct FoldSubviewsIntoCmdFlushOp : public OpRewritePattern { +struct FoldSubviewsIntoCmdFlushOp : OpRewritePattern { using Base::Base; LogicalResult matchAndRewrite(CmdFlushOp op, PatternRewriter &rewriter) const override { @@ -2947,8 +2942,7 @@ namespace { // -> // %new_offset = arith.addi %offset, %subview_offset // stream.cmd.invalidate %dst[%new_offset for %subview_length] -struct FoldSubviewsIntoCmdInvalidateOp - : public OpRewritePattern { +struct FoldSubviewsIntoCmdInvalidateOp : OpRewritePattern { using Base::Base; LogicalResult matchAndRewrite(CmdInvalidateOp op, PatternRewriter &rewriter) const override { @@ -2990,7 +2984,7 @@ namespace { // -> // %new_offset = arith.addi %offset, %subview_offset // stream.cmd.discard %dst[%new_offset for %subview_length] -struct FoldSubviewsIntoCmdDiscardOp : public OpRewritePattern { +struct FoldSubviewsIntoCmdDiscardOp : OpRewritePattern { using Base::Base; LogicalResult matchAndRewrite(CmdDiscardOp op, PatternRewriter &rewriter) const override { @@ -3032,7 +3026,7 @@ namespace { // -> // %new_offset = arith.addi %offset, %subview_offset // stream.cmd.fill %cst, %dst[%new_offset for %subview_length] -struct FoldSubviewsIntoCmdFillOp : public OpRewritePattern { +struct FoldSubviewsIntoCmdFillOp : OpRewritePattern { using Base::Base; LogicalResult matchAndRewrite(CmdFillOp op, PatternRewriter &rewriter) const override { @@ -3075,7 +3069,7 @@ namespace { // -> // %new_offset = arith.addi %offset, %subview_offset // stream.cmd.copy %src[%new_offset], %dst[%new_offset], %subview_length -struct FoldSubviewsIntoCmdCopyOp : public OpRewritePattern { +struct FoldSubviewsIntoCmdCopyOp : OpRewritePattern { using Base::Base; LogicalResult matchAndRewrite(CmdCopyOp op, PatternRewriter &rewriter) const override { @@ -3139,7 +3133,7 @@ namespace { // rw %0[%new_offset] ... {%subview_length} // } template -struct FoldSubviewsIntoDispatchOp : public OpRewritePattern { +struct FoldSubviewsIntoDispatchOp : OpRewritePattern { using OpRewritePattern::OpRewritePattern; LogicalResult matchAndRewrite(Op op, PatternRewriter &rewriter) const override { @@ -3195,8 +3189,7 @@ void CmdCollectiveOp::getCanonicalizationPatterns(RewritePatternSet &results, namespace { -struct DeduplicateCmdDispatchEntryRefs final - : public OpRewritePattern { +struct DeduplicateCmdDispatchEntryRefs final : OpRewritePattern { using Base::Base; LogicalResult matchAndRewrite(CmdDispatchOp dispatchOp, PatternRewriter &rewriter) const override { @@ -3228,7 +3221,7 @@ namespace { // TODO(benvanik): make this something on the DispatchOpInterface. // This duplicates FoldSubviewsIntoDispatchOp to handle the call op until the // interface can be written. -struct FoldSubviewsIntoCmdCallOp : public OpRewritePattern { +struct FoldSubviewsIntoCmdCallOp : OpRewritePattern { using Base::Base; LogicalResult matchAndRewrite(CmdCallOp op, PatternRewriter &rewriter) const override { @@ -3301,8 +3294,7 @@ namespace { // %1 = stream.cmd.execute with(%src as %arg0) { // %2 = stream.resource.subview %arg0[%offset] ... // } -struct CloneCapturedCmdExecuteSubviewOps - : public OpRewritePattern { +struct CloneCapturedCmdExecuteSubviewOps : OpRewritePattern { using Base::Base; LogicalResult matchAndRewrite(CmdExecuteOp op, PatternRewriter &rewriter) const override { @@ -3353,7 +3345,7 @@ struct CloneCapturedCmdExecuteSubviewOps // Elides stream.cmd.execute ops when they have no meaningful work. // The returned timepoint is replaced with an immediately resolved timepoint. -struct ElideNoOpCmdExecuteOp : public OpRewritePattern { +struct ElideNoOpCmdExecuteOp : OpRewritePattern { using Base::Base; LogicalResult matchAndRewrite(CmdExecuteOp op, PatternRewriter &rewriter) const override { @@ -3394,7 +3386,7 @@ namespace { // Elides a region-carrying op when the region is empty. // Requires no results that need replacement. template -struct ElideEmptyCmdRegionOp : public OpRewritePattern { +struct ElideEmptyCmdRegionOp : OpRewritePattern { using OpRewritePattern::OpRewritePattern; LogicalResult matchAndRewrite(OpT op, PatternRewriter &rewriter) const override { @@ -3431,8 +3423,7 @@ void CmdConcurrentOp::getCanonicalizationPatterns(RewritePatternSet &results, namespace { -struct FoldParameterLoadTargetSubviews - : public OpRewritePattern { +struct FoldParameterLoadTargetSubviews : OpRewritePattern { using Base::Base; LogicalResult matchAndRewrite(CmdParameterLoadOp op, PatternRewriter &rewriter) const override { @@ -3497,8 +3488,7 @@ void CmdParameterLoadOp::getCanonicalizationPatterns(RewritePatternSet &results, namespace { -struct FoldParameterReadTargetSubview - : public OpRewritePattern { +struct FoldParameterReadTargetSubview : OpRewritePattern { using Base::Base; LogicalResult matchAndRewrite(CmdParameterReadOp op, PatternRewriter &rewriter) const override { @@ -3551,8 +3541,7 @@ void CmdParameterReadOp::getCanonicalizationPatterns(RewritePatternSet &results, namespace { -struct FoldParameterWriteSourceSubview - : public OpRewritePattern { +struct FoldParameterWriteSourceSubview : OpRewritePattern { using Base::Base; LogicalResult matchAndRewrite(CmdParameterWriteOp op, PatternRewriter &rewriter) const override { @@ -3606,7 +3595,7 @@ void CmdParameterWriteOp::getCanonicalizationPatterns( namespace { struct FoldCmdParameterGatherTargetSubview - : public OpRewritePattern { + : OpRewritePattern { using Base::Base; LogicalResult matchAndRewrite(CmdParameterGatherOp op, PatternRewriter &rewriter) const override { @@ -3654,7 +3643,7 @@ void CmdParameterGatherOp::getCanonicalizationPatterns( namespace { struct FoldCmdParameterScatterSourceSubview - : public OpRewritePattern { + : OpRewritePattern { using Base::Base; LogicalResult matchAndRewrite(CmdParameterScatterOp op, PatternRewriter &rewriter) const override { @@ -3740,8 +3729,7 @@ namespace { // stream.timepoint.chain_external %timepoint => (%chained_fence : !hal.fence) // -> // %chained_fence = %arg_fence -struct PassThroughChainExternal - : public OpRewritePattern { +struct PassThroughChainExternal : OpRewritePattern { using Base::Base; LogicalResult matchAndRewrite(TimepointChainExternalOp op, PatternRewriter &rewriter) const override { @@ -3816,8 +3804,7 @@ OpFoldResult TimepointJoinOp::fold(FoldAdaptor operands) { namespace { -struct ElideImmediateTimepointJoinOperands - : public OpRewritePattern { +struct ElideImmediateTimepointJoinOperands : OpRewritePattern { using Base::Base; LogicalResult matchAndRewrite(TimepointJoinOp op, PatternRewriter &rewriter) const override { @@ -3843,8 +3830,7 @@ struct ElideImmediateTimepointJoinOperands } }; -struct FoldDuplicateTimepointJoinOperands - : public OpRewritePattern { +struct FoldDuplicateTimepointJoinOperands : OpRewritePattern { using Base::Base; LogicalResult matchAndRewrite(TimepointJoinOp op, PatternRewriter &rewriter) const override { @@ -3867,7 +3853,7 @@ struct FoldDuplicateTimepointJoinOperands // %j1 = stream.timepoint.join max(%tp2, %j0, %tp3) // Which we want to fold and expand: // %j1 = stream.timepoint.join max(%tp2, %tp0, %tp1, %tp3) -struct ExpandTimepointJoinOperands : public OpRewritePattern { +struct ExpandTimepointJoinOperands : OpRewritePattern { using Base::Base; LogicalResult matchAndRewrite(TimepointJoinOp op, PatternRewriter &rewriter) const override { @@ -3935,7 +3921,7 @@ static bool isSourceImmediatelyResolved(Value resource) { // %r0a = stream.resource.alloc // %r0b = %r0a // %r0ready = stream.timepoint.immediate -struct ElideImmediateBarrier : public OpRewritePattern { +struct ElideImmediateBarrier : OpRewritePattern { using Base::Base; LogicalResult matchAndRewrite(TimepointBarrierOp barrierOp, PatternRewriter &rewriter) const override { @@ -3983,7 +3969,7 @@ findSourceAwaitOp(Value resource) { // -> // %r0b = %source // %t1 = %t0 -struct ChainTimepoints : public OpRewritePattern { +struct ChainTimepoints : OpRewritePattern { using Base::Base; LogicalResult matchAndRewrite(TimepointBarrierOp barrierOp, PatternRewriter &rewriter) const override { @@ -4037,7 +4023,7 @@ LogicalResult TimepointAwaitOp::fold(FoldAdaptor operands, namespace { -struct ElideImmediateHostAwaits : public OpRewritePattern { +struct ElideImmediateHostAwaits : OpRewritePattern { using Base::Base; LogicalResult matchAndRewrite(TimepointAwaitOp op, PatternRewriter &rewriter) const override { @@ -4052,7 +4038,7 @@ struct ElideImmediateHostAwaits : public OpRewritePattern { // Sinks an await down to the first consumer of any resource. Note that there // may be multiple resources guarded by the await. -struct SinkAwaitToFirstConsumer : public OpRewritePattern { +struct SinkAwaitToFirstConsumer : OpRewritePattern { using Base::Base; LogicalResult matchAndRewrite(TimepointAwaitOp op, PatternRewriter &rewriter) const override { @@ -4116,7 +4102,7 @@ struct SinkAwaitToFirstConsumer : public OpRewritePattern { // Moves stream.resource.subview ops across to results of an await. // This allows us to pass-through the subviews to consumers that can hopefully // fold the range. -struct SinkSubviewsAcrossAwaits : public OpRewritePattern { +struct SinkSubviewsAcrossAwaits : OpRewritePattern { using Base::Base; LogicalResult matchAndRewrite(TimepointAwaitOp op, PatternRewriter &rewriter) const override { @@ -4185,7 +4171,7 @@ static bool areAllOperandsDefinedBy(Operation *op, Operation *insertionPoint, // !stream.resource{%c4000}, !stream.resource{%c4000} // %7 = stream.tensor.export %6#0 ... // %9 = stream.tensor.export %6#1 ... -struct GroupAwaitsByTimepoint : public OpRewritePattern { +struct GroupAwaitsByTimepoint : OpRewritePattern { using Base::Base; LogicalResult matchAndRewrite(TimepointAwaitOp op, PatternRewriter &rewriter) const override { @@ -4255,7 +4241,7 @@ struct GroupAwaitsByTimepoint : public OpRewritePattern { // %1:4 = stream.timepoint.await %tp => %1, %1, %2, %2 // -> // %1:2 = stream.timepoint.await %tp => %1, %2 -struct FoldDuplicateAwaitResources : public OpRewritePattern { +struct FoldDuplicateAwaitResources : OpRewritePattern { using Base::Base; LogicalResult matchAndRewrite(TimepointAwaitOp op, PatternRewriter &rewriter) const override { @@ -4297,7 +4283,7 @@ struct FoldDuplicateAwaitResources : public OpRewritePattern { } }; -struct ElideUnusedTimepointAwait : public OpRewritePattern { +struct ElideUnusedTimepointAwait : OpRewritePattern { using Base::Base; LogicalResult matchAndRewrite(TimepointAwaitOp op, PatternRewriter &rewriter) const override { diff --git a/compiler/src/iree/compiler/Dialect/Stream/IR/StreamOps.cpp b/compiler/src/iree/compiler/Dialect/Stream/IR/StreamOps.cpp index b9abc82d92b2..3e499fc9a728 100644 --- a/compiler/src/iree/compiler/Dialect/Stream/IR/StreamOps.cpp +++ b/compiler/src/iree/compiler/Dialect/Stream/IR/StreamOps.cpp @@ -2080,7 +2080,7 @@ SmallVector ResourceTransientsOp::getTiedResultOperandIndices() { namespace { struct FoldConsecutiveResourceTransientsOps - : public OpRewritePattern { + : OpRewritePattern { using OpRewritePattern::OpRewritePattern; LogicalResult matchAndRewrite(ResourceTransientsOp op, PatternRewriter &rewriter) const override { diff --git a/compiler/src/iree/compiler/Dialect/Stream/Transforms/AnnotateAffinities.cpp b/compiler/src/iree/compiler/Dialect/Stream/Transforms/AnnotateAffinities.cpp index 440c0341b626..e00d1ca1fe94 100644 --- a/compiler/src/iree/compiler/Dialect/Stream/Transforms/AnnotateAffinities.cpp +++ b/compiler/src/iree/compiler/Dialect/Stream/Transforms/AnnotateAffinities.cpp @@ -126,8 +126,7 @@ static void annotateFuncOp(FunctionOpInterface funcOp, } struct AnnotateAffinitiesPass - : public IREE::Stream::impl::AnnotateAffinitiesPassBase< - AnnotateAffinitiesPass> { + : IREE::Stream::impl::AnnotateAffinitiesPassBase { void runOnOperation() override { // Run affinity analysis on the whole module. AffinityAnalysis affinityAnalysis(getOperation()); diff --git a/compiler/src/iree/compiler/Dialect/Stream/Transforms/AnnotateConstantTransientSize.cpp b/compiler/src/iree/compiler/Dialect/Stream/Transforms/AnnotateConstantTransientSize.cpp index d188525a213d..2d2197473462 100644 --- a/compiler/src/iree/compiler/Dialect/Stream/Transforms/AnnotateConstantTransientSize.cpp +++ b/compiler/src/iree/compiler/Dialect/Stream/Transforms/AnnotateConstantTransientSize.cpp @@ -64,7 +64,7 @@ detectConstantReturn(IREE::Util::FuncOp funcOp) { } struct AnnotateConstantTransientSizePass - : public IREE::Stream::impl::AnnotateConstantTransientSizePassBase< + : IREE::Stream::impl::AnnotateConstantTransientSizePassBase< AnnotateConstantTransientSizePass> { void runOnOperation() override { ModuleOp moduleOp = getOperation(); diff --git a/compiler/src/iree/compiler/Dialect/Stream/Transforms/AnnotateDispatchArguments.cpp b/compiler/src/iree/compiler/Dialect/Stream/Transforms/AnnotateDispatchArguments.cpp index 6197f580acd5..a589e5812a5e 100644 --- a/compiler/src/iree/compiler/Dialect/Stream/Transforms/AnnotateDispatchArguments.cpp +++ b/compiler/src/iree/compiler/Dialect/Stream/Transforms/AnnotateDispatchArguments.cpp @@ -546,7 +546,7 @@ static void annotateExport(IREE::Stream::ExecutableOp executableOp, //===----------------------------------------------------------------------===// struct AnnotateDispatchArgumentsPass - : public IREE::Stream::impl::AnnotateDispatchArgumentsPassBase< + : IREE::Stream::impl::AnnotateDispatchArgumentsPassBase< AnnotateDispatchArgumentsPass> { void runOnOperation() override { // Perform argument value analysis. diff --git a/compiler/src/iree/compiler/Dialect/Stream/Transforms/AutomaticReferenceCounting.cpp b/compiler/src/iree/compiler/Dialect/Stream/Transforms/AutomaticReferenceCounting.cpp index 04a834a5ad31..f8c6d53c58d4 100644 --- a/compiler/src/iree/compiler/Dialect/Stream/Transforms/AutomaticReferenceCounting.cpp +++ b/compiler/src/iree/compiler/Dialect/Stream/Transforms/AutomaticReferenceCounting.cpp @@ -1102,7 +1102,7 @@ static void processFuncOp(FunctionOpInterface funcOp) { // soon - though knowing ML, it'll be 2030 by the time we have frontends that // can generate a freaking if statement. struct AutomaticReferenceCountingPass - : public IREE::Stream::impl::AutomaticReferenceCountingPassBase< + : IREE::Stream::impl::AutomaticReferenceCountingPassBase< AutomaticReferenceCountingPass> { void runOnOperation() override { mlir::ModuleOp moduleOp = getOperation(); diff --git a/compiler/src/iree/compiler/Dialect/Stream/Transforms/CloneToConsumers.cpp b/compiler/src/iree/compiler/Dialect/Stream/Transforms/CloneToConsumers.cpp index bf66d2c9a855..3e83de0d16eb 100644 --- a/compiler/src/iree/compiler/Dialect/Stream/Transforms/CloneToConsumers.cpp +++ b/compiler/src/iree/compiler/Dialect/Stream/Transforms/CloneToConsumers.cpp @@ -166,8 +166,7 @@ static bool tryCloneToConsumersInRegion(Operation *op, Region ®ion, // Clones ops that request cloning to consumers when their affinity is // ambiguous. struct CloneToConsumersPass - : public IREE::Stream::impl::CloneToConsumersPassBase< - CloneToConsumersPass> { + : IREE::Stream::impl::CloneToConsumersPassBase { void runOnOperation() override { mlir::ModuleOp moduleOp = getOperation(); if (moduleOp.getBody()->empty()) { diff --git a/compiler/src/iree/compiler/Dialect/Stream/Transforms/ConvertToStream.cpp b/compiler/src/iree/compiler/Dialect/Stream/Transforms/ConvertToStream.cpp index 303d1bad03db..a0379a6e5f3d 100644 --- a/compiler/src/iree/compiler/Dialect/Stream/Transforms/ConvertToStream.cpp +++ b/compiler/src/iree/compiler/Dialect/Stream/Transforms/ConvertToStream.cpp @@ -62,7 +62,7 @@ static bool doesOperationNeedWrapping(Operation *op) { // Fallback handler for unknown ops taking/returning tensors that need to be // marshaled into/outof stream resource types. -struct GenericResourcePattern : public ConversionPattern { +struct GenericResourcePattern : ConversionPattern { GenericResourcePattern(MLIRContext *context, TypeConverter &converter, IREE::Stream::AffinityAnalysis *affinityAnalysis) : ConversionPattern(converter, MatchAnyOpTypeTag(), 0, context), @@ -238,7 +238,7 @@ static void stripAffinityAttrs(ModuleOp moduleOp) { //===----------------------------------------------------------------------===// struct ConvertToStreamPass final - : public IREE::Stream::impl::ConvertToStreamPassBase { + : IREE::Stream::impl::ConvertToStreamPassBase { void runOnOperation() override { auto *context = &getContext(); diff --git a/compiler/src/iree/compiler/Dialect/Stream/Transforms/DumpStatistics.cpp b/compiler/src/iree/compiler/Dialect/Stream/Transforms/DumpStatistics.cpp index 585d19bcc802..4c0e637b480b 100644 --- a/compiler/src/iree/compiler/Dialect/Stream/Transforms/DumpStatistics.cpp +++ b/compiler/src/iree/compiler/Dialect/Stream/Transforms/DumpStatistics.cpp @@ -591,7 +591,7 @@ openOutputFile(StringRef filePath) { } struct DumpStatisticsPass - : public IREE::Stream::impl::DumpStatisticsPassBase { + : IREE::Stream::impl::DumpStatisticsPassBase { using IREE::Stream::impl::DumpStatisticsPassBase< DumpStatisticsPass>::DumpStatisticsPassBase; void runOnOperation() override { diff --git a/compiler/src/iree/compiler/Dialect/Stream/Transforms/ElideAsyncCopies.cpp b/compiler/src/iree/compiler/Dialect/Stream/Transforms/ElideAsyncCopies.cpp index e31635e9d7dc..521bd29b2303 100644 --- a/compiler/src/iree/compiler/Dialect/Stream/Transforms/ElideAsyncCopies.cpp +++ b/compiler/src/iree/compiler/Dialect/Stream/Transforms/ElideAsyncCopies.cpp @@ -1590,8 +1590,7 @@ static ElisionResults tryElideAsyncCopiesInRegion( // copies are elided: we are guaranteed to reach a fixed point as we are only // removing copies in this pass and not introducing any new ops. struct ElideAsyncCopiesPass - : public IREE::Stream::impl::ElideAsyncCopiesPassBase< - ElideAsyncCopiesPass> { + : IREE::Stream::impl::ElideAsyncCopiesPassBase { void runOnOperation() override { mlir::ModuleOp moduleOp = getOperation(); if (moduleOp.getBody()->empty()) { diff --git a/compiler/src/iree/compiler/Dialect/Stream/Transforms/ElideTimepoints.cpp b/compiler/src/iree/compiler/Dialect/Stream/Transforms/ElideTimepoints.cpp index 6534af5c5ba0..0478e4e7f3ab 100644 --- a/compiler/src/iree/compiler/Dialect/Stream/Transforms/ElideTimepoints.cpp +++ b/compiler/src/iree/compiler/Dialect/Stream/Transforms/ElideTimepoints.cpp @@ -1826,7 +1826,7 @@ static bool tryElideTimepointsInRegion(Region ®ion, //===----------------------------------------------------------------------===// struct ElideTimepointsPass - : public IREE::Stream::impl::ElideTimepointsPassBase { + : IREE::Stream::impl::ElideTimepointsPassBase { void runOnOperation() override { mlir::ModuleOp moduleOp = getOperation(); if (moduleOp.getBody()->empty()) { diff --git a/compiler/src/iree/compiler/Dialect/Stream/Transforms/EmplaceAllocations.cpp b/compiler/src/iree/compiler/Dialect/Stream/Transforms/EmplaceAllocations.cpp index 2ff75b1c9067..2a8d589def53 100644 --- a/compiler/src/iree/compiler/Dialect/Stream/Transforms/EmplaceAllocations.cpp +++ b/compiler/src/iree/compiler/Dialect/Stream/Transforms/EmplaceAllocations.cpp @@ -302,8 +302,7 @@ static bool emplaceAllocationsInRegion(Region ®ion) { //===----------------------------------------------------------------------===// struct EmplaceAllocationsPass - : public IREE::Stream::impl::EmplaceAllocationsPassBase< - EmplaceAllocationsPass> { + : IREE::Stream::impl::EmplaceAllocationsPassBase { void runOnOperation() override { bool didChange = false; getOperation()->walk([&](Region *region) { diff --git a/compiler/src/iree/compiler/Dialect/Stream/Transforms/EmplaceTransients.cpp b/compiler/src/iree/compiler/Dialect/Stream/Transforms/EmplaceTransients.cpp index 2315d95974c0..6dff18a5493f 100644 --- a/compiler/src/iree/compiler/Dialect/Stream/Transforms/EmplaceTransients.cpp +++ b/compiler/src/iree/compiler/Dialect/Stream/Transforms/EmplaceTransients.cpp @@ -1624,8 +1624,7 @@ static LogicalResult emplaceTransientsInFuncOp(FunctionOpInterface funcOp, } struct EmplaceTransientsPass - : public IREE::Stream::impl::EmplaceTransientsPassBase< - EmplaceTransientsPass> { + : IREE::Stream::impl::EmplaceTransientsPassBase { void runOnOperation() override { mlir::ModuleOp moduleOp = getOperation(); if (moduleOp.getBody()->empty()) { diff --git a/compiler/src/iree/compiler/Dialect/Stream/Transforms/EncodeTensors.cpp b/compiler/src/iree/compiler/Dialect/Stream/Transforms/EncodeTensors.cpp index 6491b054b361..107cfb35f35c 100644 --- a/compiler/src/iree/compiler/Dialect/Stream/Transforms/EncodeTensors.cpp +++ b/compiler/src/iree/compiler/Dialect/Stream/Transforms/EncodeTensors.cpp @@ -200,8 +200,7 @@ static Value canonicalizeFillPattern(Value pattern, RankedTensorType resultType, // stream.tensor.import //===----------------------------------------------------------------------===// -struct EncodeTensorImportOp - : public OpRewritePattern { +struct EncodeTensorImportOp : OpRewritePattern { using Base::Base; LogicalResult matchAndRewrite(IREE::Stream::TensorImportOp op, PatternRewriter &rewriter) const override { @@ -223,8 +222,7 @@ struct EncodeTensorImportOp // stream.tensor.export //===----------------------------------------------------------------------===// -struct EncodeTensorExportOp - : public OpRewritePattern { +struct EncodeTensorExportOp : OpRewritePattern { using Base::Base; LogicalResult matchAndRewrite(IREE::Stream::TensorExportOp op, PatternRewriter &rewriter) const override { @@ -246,8 +244,7 @@ struct EncodeTensorExportOp // stream.tensor.sizeof //===----------------------------------------------------------------------===// -struct EncodeTensorSizeOfOp - : public OpRewritePattern { +struct EncodeTensorSizeOfOp : OpRewritePattern { using Base::Base; LogicalResult matchAndRewrite(IREE::Stream::TensorSizeOfOp op, PatternRewriter &rewriter) const override { @@ -274,8 +271,7 @@ struct EncodeTensorSizeOfOp // stream.tensor.empty //===----------------------------------------------------------------------===// -struct EncodeTensorEmptyOp - : public OpRewritePattern { +struct EncodeTensorEmptyOp : OpRewritePattern { using Base::Base; LogicalResult matchAndRewrite(IREE::Stream::TensorEmptyOp op, PatternRewriter &rewriter) const override { @@ -298,7 +294,7 @@ struct EncodeTensorEmptyOp //===----------------------------------------------------------------------===// struct EncodeTensorConstantOp - : public OpRewritePattern { + : OpRewritePattern { using Base::Base; LogicalResult matchAndRewrite(IREE::Stream::TensorConstantOp op, PatternRewriter &rewriter) const override { @@ -358,8 +354,7 @@ struct EncodeTensorConstantOp // stream.tensor.splat //===----------------------------------------------------------------------===// -struct EncodeTensorSplatOp - : public OpRewritePattern { +struct EncodeTensorSplatOp : OpRewritePattern { using Base::Base; LogicalResult matchAndRewrite(IREE::Stream::TensorSplatOp op, PatternRewriter &rewriter) const override { @@ -391,8 +386,7 @@ struct EncodeTensorSplatOp // stream.tensor.clone //===----------------------------------------------------------------------===// -struct EncodeTensorCloneOp - : public OpRewritePattern { +struct EncodeTensorCloneOp : OpRewritePattern { using Base::Base; LogicalResult matchAndRewrite(IREE::Stream::TensorCloneOp op, PatternRewriter &rewriter) const override { @@ -420,8 +414,7 @@ struct EncodeTensorCloneOp // stream.tensor.slice //===----------------------------------------------------------------------===// -struct EncodeTensorSliceOp - : public OpRewritePattern { +struct EncodeTensorSliceOp : OpRewritePattern { using Base::Base; LogicalResult matchAndRewrite(IREE::Stream::TensorSliceOp op, PatternRewriter &rewriter) const override { @@ -453,8 +446,7 @@ struct EncodeTensorSliceOp // stream.tensor.fill //===----------------------------------------------------------------------===// -struct EncodeTensorFillOp - : public OpRewritePattern { +struct EncodeTensorFillOp : OpRewritePattern { using Base::Base; LogicalResult matchAndRewrite(IREE::Stream::TensorFillOp op, PatternRewriter &rewriter) const override { @@ -492,8 +484,7 @@ struct EncodeTensorFillOp // stream.tensor.update //===----------------------------------------------------------------------===// -struct EncodeTensorUpdateOp - : public OpRewritePattern { +struct EncodeTensorUpdateOp : OpRewritePattern { using Base::Base; LogicalResult matchAndRewrite(IREE::Stream::TensorUpdateOp op, PatternRewriter &rewriter) const override { @@ -526,8 +517,7 @@ struct EncodeTensorUpdateOp // stream.tensor.load //===----------------------------------------------------------------------===// -struct EncodeTensorLoadOp - : public OpRewritePattern { +struct EncodeTensorLoadOp : OpRewritePattern { using Base::Base; LogicalResult matchAndRewrite(IREE::Stream::TensorLoadOp op, PatternRewriter &rewriter) const override { @@ -569,8 +559,7 @@ struct EncodeTensorLoadOp // stream.tensor.store //===----------------------------------------------------------------------===// -struct EncodeTensorStoreOp - : public OpRewritePattern { +struct EncodeTensorStoreOp : OpRewritePattern { using Base::Base; LogicalResult matchAndRewrite(IREE::Stream::TensorStoreOp op, PatternRewriter &rewriter) const override { @@ -600,7 +589,7 @@ struct EncodeTensorStoreOp //===----------------------------------------------------------------------===// struct EncodeTensorDispatchOp - : public OpRewritePattern { + : OpRewritePattern { using Base::Base; LogicalResult matchAndRewrite(IREE::Stream::TensorDispatchOp op, PatternRewriter &rewriter) const override { @@ -635,7 +624,7 @@ struct EncodeTensorDispatchOp //===----------------------------------------------------------------------===// struct EncodeTensorParameterLoadOp - : public OpRewritePattern { + : OpRewritePattern { using Base::Base; LogicalResult matchAndRewrite(IREE::Stream::TensorParameterLoadOp op, PatternRewriter &rewriter) const override { @@ -675,7 +664,7 @@ struct EncodeTensorParameterLoadOp //===----------------------------------------------------------------------===// struct EncodeTensorParameterWriteOp - : public OpRewritePattern { + : OpRewritePattern { using Base::Base; LogicalResult matchAndRewrite(IREE::Stream::TensorParameterWriteOp op, PatternRewriter &rewriter) const override { @@ -713,8 +702,7 @@ struct EncodeTensorParameterWriteOp //===----------------------------------------------------------------------===// struct EncodeHostTensorsPass - : public IREE::Stream::impl::EncodeHostTensorsPassBase< - EncodeHostTensorsPass> { + : IREE::Stream::impl::EncodeHostTensorsPassBase { void runOnOperation() override { RewritePatternSet patterns(&getContext()); patterns.insert< @@ -757,7 +745,7 @@ alignDispatchTensorType(IREE::TensorExt::DispatchTensorType originalType) { // conversion to ensure both host and device agree upon the number of bytes in // a resource. struct EncodeBindingSubspanOp - : public OpRewritePattern { + : OpRewritePattern { using Base::Base; LogicalResult matchAndRewrite(IREE::Stream::BindingSubspanOp op, PatternRewriter &rewriter) const override { @@ -788,7 +776,7 @@ struct EncodeBindingSubspanOp //===----------------------------------------------------------------------===// struct EncodeDispatchTensorLoadOp - : public OpRewritePattern { + : OpRewritePattern { using Base::Base; LogicalResult matchAndRewrite(IREE::TensorExt::DispatchTensorLoadOp op, PatternRewriter &rewriter) const override { @@ -823,7 +811,7 @@ struct EncodeDispatchTensorLoadOp //===----------------------------------------------------------------------===// struct EncodeDispatchTensorStoreOp - : public OpRewritePattern { + : OpRewritePattern { using Base::Base; LogicalResult matchAndRewrite(IREE::TensorExt::DispatchTensorStoreOp op, PatternRewriter &rewriter) const override { @@ -854,8 +842,7 @@ struct EncodeDispatchTensorStoreOp //===----------------------------------------------------------------------===// struct EncodeDeviceTensorsPass - : public IREE::Stream::impl::EncodeDeviceTensorsPassBase< - EncodeDeviceTensorsPass> { + : IREE::Stream::impl::EncodeDeviceTensorsPassBase { void runOnOperation() override { RewritePatternSet patterns(&getContext()); patterns.insert { + : IREE::Stream::impl::FoldUniformOperandsPassBase { void runOnOperation() override { SymbolTable symbolTable(getOperation()); diff --git a/compiler/src/iree/compiler/Dialect/Stream/Transforms/FuseDispatchBindings.cpp b/compiler/src/iree/compiler/Dialect/Stream/Transforms/FuseDispatchBindings.cpp index 5ca60ead127b..293a03c9d070 100644 --- a/compiler/src/iree/compiler/Dialect/Stream/Transforms/FuseDispatchBindings.cpp +++ b/compiler/src/iree/compiler/Dialect/Stream/Transforms/FuseDispatchBindings.cpp @@ -414,7 +414,7 @@ fuseDispatchBindings(IREE::Stream::ExecutableOp executableOp, //===----------------------------------------------------------------------===// struct FuseDispatchBindingsPass - : public IREE::Stream::impl::FuseDispatchBindingsPassBase< + : IREE::Stream::impl::FuseDispatchBindingsPassBase< FuseDispatchBindingsPass> { // TODO(benvanik): preserve the information we are eliding by inserting // appropriate memory ops. On devices that require prefetching and other diff --git a/compiler/src/iree/compiler/Dialect/Stream/Transforms/LayoutSlices.cpp b/compiler/src/iree/compiler/Dialect/Stream/Transforms/LayoutSlices.cpp index 184c713300e0..f763d8076bb3 100644 --- a/compiler/src/iree/compiler/Dialect/Stream/Transforms/LayoutSlices.cpp +++ b/compiler/src/iree/compiler/Dialect/Stream/Transforms/LayoutSlices.cpp @@ -219,7 +219,7 @@ packDynamicSlicesConservatively(Location loc, Value baseOffset, //===----------------------------------------------------------------------===// struct LayoutSlicesPass - : public IREE::Stream::impl::LayoutSlicesPassBase { + : IREE::Stream::impl::LayoutSlicesPassBase { void runOnOperation() override { mlir::CallableOpInterface parentOp = getOperation(); if (!parentOp.getCallableRegion() || diff --git a/compiler/src/iree/compiler/Dialect/Stream/Transforms/MaterializeBuiltins.cpp b/compiler/src/iree/compiler/Dialect/Stream/Transforms/MaterializeBuiltins.cpp index a3e642351b9d..e1b619207535 100644 --- a/compiler/src/iree/compiler/Dialect/Stream/Transforms/MaterializeBuiltins.cpp +++ b/compiler/src/iree/compiler/Dialect/Stream/Transforms/MaterializeBuiltins.cpp @@ -347,8 +347,7 @@ static LogicalResult processFillOp(IREE::Stream::AsyncFillOp fillOp, //===----------------------------------------------------------------------===// struct MaterializeBuiltinsPass - : public IREE::Stream::impl::MaterializeBuiltinsPassBase< - MaterializeBuiltinsPass> { + : IREE::Stream::impl::MaterializeBuiltinsPassBase { void runOnOperation() override { mlir::ModuleOp moduleOp = getOperation(); if (moduleOp.getBody()->empty()) { diff --git a/compiler/src/iree/compiler/Dialect/Stream/Transforms/MaterializeCopyOnWrite.cpp b/compiler/src/iree/compiler/Dialect/Stream/Transforms/MaterializeCopyOnWrite.cpp index 65211e9e23b6..cb730ae0f8b3 100644 --- a/compiler/src/iree/compiler/Dialect/Stream/Transforms/MaterializeCopyOnWrite.cpp +++ b/compiler/src/iree/compiler/Dialect/Stream/Transforms/MaterializeCopyOnWrite.cpp @@ -188,7 +188,7 @@ static bool materializeRegionCOW(Region ®ion) { // additional copies it is easier to ensure that each pass works independently // and also makes it easy to disable copy elision to ferret out issues. struct MaterializeCopyOnWritePass - : public IREE::Stream::impl::MaterializeCopyOnWritePassBase< + : IREE::Stream::impl::MaterializeCopyOnWritePassBase< MaterializeCopyOnWritePass> { void runOnOperation() override { bool didChange = false; diff --git a/compiler/src/iree/compiler/Dialect/Stream/Transforms/MaterializeEncodings.cpp b/compiler/src/iree/compiler/Dialect/Stream/Transforms/MaterializeEncodings.cpp index 4f5451edc38a..d728e6c8025d 100644 --- a/compiler/src/iree/compiler/Dialect/Stream/Transforms/MaterializeEncodings.cpp +++ b/compiler/src/iree/compiler/Dialect/Stream/Transforms/MaterializeEncodings.cpp @@ -30,7 +30,7 @@ namespace mlir::iree_compiler::IREE::Stream { namespace { struct MaterializeEncodingsPass - : public IREE::Stream::impl::MaterializeEncodingsPassBase< + : IREE::Stream::impl::MaterializeEncodingsPassBase< MaterializeEncodingsPass> { void runOnOperation() override; }; diff --git a/compiler/src/iree/compiler/Dialect/Stream/Transforms/MaterializeTransientSizeQueries.cpp b/compiler/src/iree/compiler/Dialect/Stream/Transforms/MaterializeTransientSizeQueries.cpp index bbd58593e432..7d2be6e835f8 100644 --- a/compiler/src/iree/compiler/Dialect/Stream/Transforms/MaterializeTransientSizeQueries.cpp +++ b/compiler/src/iree/compiler/Dialect/Stream/Transforms/MaterializeTransientSizeQueries.cpp @@ -137,7 +137,7 @@ generateSizeQueryFunction(FunctionOpInterface funcOp, StringRef sizeQueryName, } struct MaterializeTransientSizeQueriesPass - : public IREE::Stream::impl::MaterializeTransientSizeQueriesPassBase< + : IREE::Stream::impl::MaterializeTransientSizeQueriesPassBase< MaterializeTransientSizeQueriesPass> { void runOnOperation() override { mlir::ModuleOp moduleOp = getOperation(); diff --git a/compiler/src/iree/compiler/Dialect/Stream/Transforms/PackConstants.cpp b/compiler/src/iree/compiler/Dialect/Stream/Transforms/PackConstants.cpp index 5580e89203a0..e5a1dc758a93 100644 --- a/compiler/src/iree/compiler/Dialect/Stream/Transforms/PackConstants.cpp +++ b/compiler/src/iree/compiler/Dialect/Stream/Transforms/PackConstants.cpp @@ -670,7 +670,7 @@ static Value generateUploads(Value awaitTimepoint, // never a case where this matters by construction; which is a feature :P struct PackConstantsPass - : public IREE::Stream::impl::PackConstantsPassBase { + : IREE::Stream::impl::PackConstantsPassBase { void runOnOperation() override { mlir::CallableOpInterface parentOp = getOperation(); if (!parentOp || !parentOp.getCallableRegion() || diff --git a/compiler/src/iree/compiler/Dialect/Stream/Transforms/PackDispatchOperands.cpp b/compiler/src/iree/compiler/Dialect/Stream/Transforms/PackDispatchOperands.cpp index 3427890e5ca5..033e29c44c00 100644 --- a/compiler/src/iree/compiler/Dialect/Stream/Transforms/PackDispatchOperands.cpp +++ b/compiler/src/iree/compiler/Dialect/Stream/Transforms/PackDispatchOperands.cpp @@ -304,7 +304,7 @@ static void updateExportFuncOp(mlir::FunctionOpInterface funcOp) { //===----------------------------------------------------------------------===// struct PackDispatchOperandsPass - : public IREE::Stream::impl::PackDispatchOperandsPassBase< + : IREE::Stream::impl::PackDispatchOperandsPassBase< PackDispatchOperandsPass> { void runOnOperation() override { SymbolTable symbolTable(getOperation()); diff --git a/compiler/src/iree/compiler/Dialect/Stream/Transforms/Passes.h b/compiler/src/iree/compiler/Dialect/Stream/Transforms/Passes.h index 4a22080f2f2a..4949d7435a58 100644 --- a/compiler/src/iree/compiler/Dialect/Stream/Transforms/Passes.h +++ b/compiler/src/iree/compiler/Dialect/Stream/Transforms/Passes.h @@ -71,7 +71,7 @@ enum class ParameterEncoderMode { // (ParameterOptions in Pipelines/Options.h) when building the full compiler // pipeline. When constructing individual passes, relevant options are mapped // to pass-specific option structs (e.g., SplitParameterEncoderPassOptions). -struct TransformOptions : public PassPipelineOptions { +struct TransformOptions : PassPipelineOptions { Option initializationMode{ *this, "initialization-mode", diff --git a/compiler/src/iree/compiler/Dialect/Stream/Transforms/PropagateTimepoints.cpp b/compiler/src/iree/compiler/Dialect/Stream/Transforms/PropagateTimepoints.cpp index 7b94ea748801..1a5a1e280632 100644 --- a/compiler/src/iree/compiler/Dialect/Stream/Transforms/PropagateTimepoints.cpp +++ b/compiler/src/iree/compiler/Dialect/Stream/Transforms/PropagateTimepoints.cpp @@ -826,8 +826,7 @@ static void expandTimepoints(Operation *op, SymbolTable &symbolTable, // example, calls are always updated to take/return timepoints and results are // always awaited, with the elision/deduplication/etc left until cleanup. struct PropagateTimepointsPass - : public IREE::Stream::impl::PropagateTimepointsPassBase< - PropagateTimepointsPass> { + : IREE::Stream::impl::PropagateTimepointsPassBase { void runOnOperation() override { mlir::ModuleOp rootOp = getOperation(); SymbolTable symbolTable(rootOp); diff --git a/compiler/src/iree/compiler/Dialect/Stream/Transforms/RefineUsage.cpp b/compiler/src/iree/compiler/Dialect/Stream/Transforms/RefineUsage.cpp index 04aa4ca26a1e..18a565f5ddc0 100644 --- a/compiler/src/iree/compiler/Dialect/Stream/Transforms/RefineUsage.cpp +++ b/compiler/src/iree/compiler/Dialect/Stream/Transforms/RefineUsage.cpp @@ -122,7 +122,7 @@ static Operation *getAnyReturnLikeOp(IREE::Util::FuncOp op) { // Base pattern type for resource usage refinement. // The results of the usage analysis are available for use by subclasses. template -struct UsageRefinementPattern : public OpRewritePattern { +struct UsageRefinementPattern : OpRewritePattern { UsageRefinementPattern(MLIRContext *context, ResourceUsageAnalysis &analysis) : OpRewritePattern(context), analysis(analysis) {} @@ -261,8 +261,7 @@ struct UsageRefinementPattern : public OpRewritePattern { // Applies usage analysis results to an initializer callable. // All nested operations will have their lifetime specified. -struct ApplyInitializerOp - : public UsageRefinementPattern { +struct ApplyInitializerOp : UsageRefinementPattern { using UsageRefinementPattern< IREE::Util::InitializerOp>::UsageRefinementPattern; LogicalResult matchAndRewrite(IREE::Util::InitializerOp op, @@ -275,7 +274,7 @@ struct ApplyInitializerOp // Applies usage analysis results to an MLIR function. // All resource arguments and results, block arguments, and nested operations // will have their lifetime specified. -struct ApplyFuncOp : public UsageRefinementPattern { +struct ApplyFuncOp : UsageRefinementPattern { using UsageRefinementPattern::UsageRefinementPattern; LogicalResult matchAndRewrite(IREE::Util::FuncOp op, PatternRewriter &rewriter) const override { @@ -346,7 +345,7 @@ struct ApplyFuncOp : public UsageRefinementPattern { } }; -struct ApplyScfIfOp : public UsageRefinementPattern { +struct ApplyScfIfOp : UsageRefinementPattern { using UsageRefinementPattern::UsageRefinementPattern; LogicalResult matchAndRewrite(mlir::scf::IfOp op, PatternRewriter &rewriter) const override { @@ -364,7 +363,7 @@ struct ApplyScfIfOp : public UsageRefinementPattern { } }; -struct ApplyScfForOp : public UsageRefinementPattern { +struct ApplyScfForOp : UsageRefinementPattern { using UsageRefinementPattern::UsageRefinementPattern; LogicalResult matchAndRewrite(mlir::scf::ForOp op, PatternRewriter &rewriter) const override { @@ -381,7 +380,7 @@ struct ApplyScfForOp : public UsageRefinementPattern { } }; -struct ApplyScfWhileOp : public UsageRefinementPattern { +struct ApplyScfWhileOp : UsageRefinementPattern { using UsageRefinementPattern::UsageRefinementPattern; LogicalResult matchAndRewrite(mlir::scf::WhileOp op, PatternRewriter &rewriter) const override { @@ -403,7 +402,7 @@ struct ApplyScfWhileOp : public UsageRefinementPattern { // All resource operands and results including those in nested regions will have // their lifetime specified. template -struct ApplyGenericOp : public UsageRefinementPattern { +struct ApplyGenericOp : UsageRefinementPattern { using UsageRefinementPattern::UsageRefinementPattern; LogicalResult matchAndRewrite(Op op, PatternRewriter &rewriter) const override { @@ -431,7 +430,7 @@ struct ApplyGenericOp : public UsageRefinementPattern { // All resource operands and results including those in nested regions will have // their lifetime specified. template -struct ApplyStreamableOp : public UsageRefinementPattern { +struct ApplyStreamableOp : UsageRefinementPattern { using UsageRefinementPattern::UsageRefinementPattern; LogicalResult matchAndRewrite(Op op, PatternRewriter &rewriter) const override { @@ -470,7 +469,7 @@ struct ApplyStreamableOp : public UsageRefinementPattern { // AsyncTransferOps with concrete lifetimes are left alone to prevent creating // chaining transfers that fight with canonicalization patterns. struct ApplyAsyncTransferOp - : public UsageRefinementPattern { + : UsageRefinementPattern { using UsageRefinementPattern< IREE::Stream::AsyncTransferOp>::UsageRefinementPattern; LogicalResult matchAndRewrite(IREE::Stream::AsyncTransferOp op, @@ -545,7 +544,7 @@ static void insertUsageRefinementPatterns(MLIRContext *context, //===----------------------------------------------------------------------===// struct RefineUsagePass - : public IREE::Stream::impl::RefineUsagePassBase { + : IREE::Stream::impl::RefineUsagePassBase { void runOnOperation() override { mlir::ModuleOp moduleOp = getOperation(); if (moduleOp.getBody()->empty()) { diff --git a/compiler/src/iree/compiler/Dialect/Stream/Transforms/ReuseAllocations.cpp b/compiler/src/iree/compiler/Dialect/Stream/Transforms/ReuseAllocations.cpp index af27da1eb3ba..4fb3e4ca8d98 100644 --- a/compiler/src/iree/compiler/Dialect/Stream/Transforms/ReuseAllocations.cpp +++ b/compiler/src/iree/compiler/Dialect/Stream/Transforms/ReuseAllocations.cpp @@ -117,8 +117,7 @@ tryReuseExistingAllocation(IREE::Stream::ResourceAllocaOp allocaOp) { } struct ReuseAllocationsPass - : public IREE::Stream::impl::ReuseAllocationsPassBase< - ReuseAllocationsPass> { + : IREE::Stream::impl::ReuseAllocationsPassBase { void runOnOperation() override { mlir::CallableOpInterface parentOp = getOperation(); if (!parentOp.getCallableRegion() || diff --git a/compiler/src/iree/compiler/Dialect/Stream/Transforms/ScheduleAllocation.cpp b/compiler/src/iree/compiler/Dialect/Stream/Transforms/ScheduleAllocation.cpp index 40642408bc16..e32aaab8a628 100644 --- a/compiler/src/iree/compiler/Dialect/Stream/Transforms/ScheduleAllocation.cpp +++ b/compiler/src/iree/compiler/Dialect/Stream/Transforms/ScheduleAllocation.cpp @@ -2185,8 +2185,7 @@ convertAsyncParameterScatterOp(IREE::Stream::AsyncParameterScatterOp asyncOp) { //===----------------------------------------------------------------------===// struct ScheduleAllocationPass - : public IREE::Stream::impl::ScheduleAllocationPassBase< - ScheduleAllocationPass> { + : IREE::Stream::impl::ScheduleAllocationPassBase { void runOnOperation() override { mlir::ModuleOp moduleOp = getOperation(); diff --git a/compiler/src/iree/compiler/Dialect/Stream/Transforms/ScheduleConcurrency.cpp b/compiler/src/iree/compiler/Dialect/Stream/Transforms/ScheduleConcurrency.cpp index 5625923d5c76..f256a88d7582 100644 --- a/compiler/src/iree/compiler/Dialect/Stream/Transforms/ScheduleConcurrency.cpp +++ b/compiler/src/iree/compiler/Dialect/Stream/Transforms/ScheduleConcurrency.cpp @@ -185,8 +185,7 @@ struct WavePartitionBuilder { //===----------------------------------------------------------------------===// struct ScheduleConcurrencyPass - : public IREE::Stream::impl::ScheduleConcurrencyPassBase< - ScheduleConcurrencyPass> { + : IREE::Stream::impl::ScheduleConcurrencyPassBase { void runOnOperation() override { mlir::CallableOpInterface parentOp = getOperation(); if (!parentOp.getCallableRegion() || diff --git a/compiler/src/iree/compiler/Dialect/Stream/Transforms/ScheduleExecution.cpp b/compiler/src/iree/compiler/Dialect/Stream/Transforms/ScheduleExecution.cpp index e4c7fb15de7b..ff5784049d3a 100644 --- a/compiler/src/iree/compiler/Dialect/Stream/Transforms/ScheduleExecution.cpp +++ b/compiler/src/iree/compiler/Dialect/Stream/Transforms/ScheduleExecution.cpp @@ -459,7 +459,7 @@ LogicalResult processRegion(Location loc, MLIRContext *context, Region ®ion, // --iree-stream-schedule-execution //===----------------------------------------------------------------------===// -struct RemoveBarriers : public OpRewritePattern { +struct RemoveBarriers : OpRewritePattern { using Base::Base; LogicalResult matchAndRewrite(IREE::Stream::AsyncBarrierOp op, PatternRewriter &rewriter) const override { @@ -469,8 +469,7 @@ struct RemoveBarriers : public OpRewritePattern { }; struct ScheduleExecutionPass - : public IREE::Stream::impl::ScheduleExecutionPassBase< - ScheduleExecutionPass> { + : IREE::Stream::impl::ScheduleExecutionPassBase { void runOnOperation() override { auto *context = &getContext(); mlir::CallableOpInterface parentOp = getOperation(); diff --git a/compiler/src/iree/compiler/Dialect/Stream/Transforms/SpecializeDispatches.cpp b/compiler/src/iree/compiler/Dialect/Stream/Transforms/SpecializeDispatches.cpp index 977c03a5d6c5..e8974e816256 100644 --- a/compiler/src/iree/compiler/Dialect/Stream/Transforms/SpecializeDispatches.cpp +++ b/compiler/src/iree/compiler/Dialect/Stream/Transforms/SpecializeDispatches.cpp @@ -333,7 +333,7 @@ specializeDispatches(IREE::Stream::ExecutableOp executableOp, //===----------------------------------------------------------------------===// struct SpecializeDispatchesPass - : public IREE::Stream::impl::SpecializeDispatchesPassBase< + : IREE::Stream::impl::SpecializeDispatchesPassBase< SpecializeDispatchesPass> { void runOnOperation() override { SymbolTable symbolTable(getOperation()); diff --git a/compiler/src/iree/compiler/Dialect/Stream/Transforms/SpecializeEncodings.cpp b/compiler/src/iree/compiler/Dialect/Stream/Transforms/SpecializeEncodings.cpp index 67a4fb5eb651..afd3e006e85a 100644 --- a/compiler/src/iree/compiler/Dialect/Stream/Transforms/SpecializeEncodings.cpp +++ b/compiler/src/iree/compiler/Dialect/Stream/Transforms/SpecializeEncodings.cpp @@ -532,7 +532,7 @@ LogicalResult StreamTensorOpUpdater::run() { namespace { struct SpecializeEncodingsPass - : public impl::SpecializeEncodingsPassBase { + : impl::SpecializeEncodingsPassBase { void runOnOperation() override { ModuleOp moduleOp = getOperation(); diff --git a/compiler/src/iree/compiler/Dialect/Stream/Transforms/SplitParameterEncoder.cpp b/compiler/src/iree/compiler/Dialect/Stream/Transforms/SplitParameterEncoder.cpp index 8346395b325e..5e6c414d27b9 100644 --- a/compiler/src/iree/compiler/Dialect/Stream/Transforms/SplitParameterEncoder.cpp +++ b/compiler/src/iree/compiler/Dialect/Stream/Transforms/SplitParameterEncoder.cpp @@ -1098,7 +1098,7 @@ struct ParameterBuilder { virtual ParameterEntry finalize() = 0; }; -struct SplatParameterBuilder : public ParameterBuilder { +struct SplatParameterBuilder : ParameterBuilder { Location loc; int64_t length = 0; Attribute pattern; @@ -1122,7 +1122,7 @@ struct SplatParameterBuilder : public ParameterBuilder { } }; -struct DataParameterBuilder : public ParameterBuilder { +struct DataParameterBuilder : ParameterBuilder { IREE::Stream::AffinityAttr affinityAttr; int64_t maxSize = 0; int64_t offsetAlignment = 0; diff --git a/compiler/src/iree/compiler/Dialect/Stream/Transforms/SyncInitializers.cpp b/compiler/src/iree/compiler/Dialect/Stream/Transforms/SyncInitializers.cpp index 277e4120e889..ed9b82562ea7 100644 --- a/compiler/src/iree/compiler/Dialect/Stream/Transforms/SyncInitializers.cpp +++ b/compiler/src/iree/compiler/Dialect/Stream/Transforms/SyncInitializers.cpp @@ -30,8 +30,7 @@ namespace { // Finds any global stores of timepoints in initializers and adds them to a // single blocking wait prior to returning. struct SyncInitializersPass - : public IREE::Stream::impl::SyncInitializersPassBase< - SyncInitializersPass> { + : IREE::Stream::impl::SyncInitializersPassBase { void runOnOperation() override { mlir::ModuleOp moduleOp = getOperation(); if (moduleOp.getBody()->empty()) { diff --git a/compiler/src/iree/compiler/Dialect/Stream/Transforms/UnifyEncodingForGlobals.cpp b/compiler/src/iree/compiler/Dialect/Stream/Transforms/UnifyEncodingForGlobals.cpp index d0fb77c42b59..000917deb0a0 100644 --- a/compiler/src/iree/compiler/Dialect/Stream/Transforms/UnifyEncodingForGlobals.cpp +++ b/compiler/src/iree/compiler/Dialect/Stream/Transforms/UnifyEncodingForGlobals.cpp @@ -740,8 +740,7 @@ static void collectUpdatesForStreamTensorOps(Explorer &explorer, } struct UnifyEncodingForGlobalsPass - : public impl::UnifyEncodingForGlobalsPassBase< - UnifyEncodingForGlobalsPass> { + : impl::UnifyEncodingForGlobalsPassBase { void runOnOperation() override { ModuleOp moduleOp = getOperation(); GlobalEncodingAnalyzer analyzer(moduleOp); diff --git a/compiler/src/iree/compiler/Dialect/Stream/Transforms/VerifyAffinities.cpp b/compiler/src/iree/compiler/Dialect/Stream/Transforms/VerifyAffinities.cpp index dc2be3195fbd..a568b39136e3 100644 --- a/compiler/src/iree/compiler/Dialect/Stream/Transforms/VerifyAffinities.cpp +++ b/compiler/src/iree/compiler/Dialect/Stream/Transforms/VerifyAffinities.cpp @@ -40,8 +40,7 @@ verifyAffinityAssigned(IREE::Stream::AffinityOpInterface op) { //===----------------------------------------------------------------------===// struct VerifyAffinitiesPass - : public IREE::Stream::impl::VerifyAffinitiesPassBase< - VerifyAffinitiesPass> { + : IREE::Stream::impl::VerifyAffinitiesPassBase { void runOnOperation() override { mlir::ModuleOp moduleOp = getOperation(); if (moduleOp diff --git a/compiler/src/iree/compiler/Dialect/Stream/Transforms/VerifyAsyncAccessRanges.cpp b/compiler/src/iree/compiler/Dialect/Stream/Transforms/VerifyAsyncAccessRanges.cpp index 3f19b271217c..d998b0e04ef1 100644 --- a/compiler/src/iree/compiler/Dialect/Stream/Transforms/VerifyAsyncAccessRanges.cpp +++ b/compiler/src/iree/compiler/Dialect/Stream/Transforms/VerifyAsyncAccessRanges.cpp @@ -115,7 +115,7 @@ verifyAsyncAccessOp(IREE::Stream::AsyncAccessOpInterface accessOp) { //===----------------------------------------------------------------------===// struct VerifyAsyncAccessRangesPass - : public IREE::Stream::impl::VerifyAsyncAccessRangesPassBase< + : IREE::Stream::impl::VerifyAsyncAccessRangesPassBase< VerifyAsyncAccessRangesPass> { void runOnOperation() override { mlir::ModuleOp moduleOp = getOperation(); diff --git a/compiler/src/iree/compiler/Dialect/Stream/Transforms/VerifyLowerings.cpp b/compiler/src/iree/compiler/Dialect/Stream/Transforms/VerifyLowerings.cpp index 816784bfd07a..aaf2cf677aa9 100644 --- a/compiler/src/iree/compiler/Dialect/Stream/Transforms/VerifyLowerings.cpp +++ b/compiler/src/iree/compiler/Dialect/Stream/Transforms/VerifyLowerings.cpp @@ -247,7 +247,7 @@ static void markStreamAsyncOpsIllegal(Verifier &verifier) { //===----------------------------------------------------------------------===// struct VerifyInputPass - : public IREE::Stream::impl::VerifyInputPassBase { + : IREE::Stream::impl::VerifyInputPassBase { void runOnOperation() override { Verifier verifier; setupDefaultOpLegality(verifier); @@ -308,7 +308,7 @@ static void markTensorInputsIllegal(Verifier &verifier) { } struct VerifyLoweringToTensorsPass - : public IREE::Stream::impl::VerifyLoweringToTensorsPassBase< + : IREE::Stream::impl::VerifyLoweringToTensorsPassBase< VerifyLoweringToTensorsPass> { void runOnOperation() override { // We cannot have stream.cmd.* ops mixed with stream.tensor/async.* ops @@ -331,7 +331,7 @@ struct VerifyLoweringToTensorsPass //===----------------------------------------------------------------------===// struct VerifyLoweringToAsyncResourcesPass - : public IREE::Stream::impl::VerifyLoweringToAsyncResourcesPassBase< + : IREE::Stream::impl::VerifyLoweringToAsyncResourcesPassBase< VerifyLoweringToAsyncResourcesPass> { void runOnOperation() override { // We cannot have stream.cmd.* ops mixed with stream.tensor/async.* ops @@ -355,7 +355,7 @@ struct VerifyLoweringToAsyncResourcesPass //===----------------------------------------------------------------------===// struct VerifyLoweringToAsyncPass - : public IREE::Stream::impl::VerifyLoweringToAsyncPassBase< + : IREE::Stream::impl::VerifyLoweringToAsyncPassBase< VerifyLoweringToAsyncPass> { void runOnOperation() override { // We cannot have stream.cmd.* ops mixed with stream.tensor/async.* ops @@ -410,8 +410,7 @@ struct VerifyLoweringToAsyncPass //===----------------------------------------------------------------------===// struct VerifyLoweringToCmdPass - : public IREE::Stream::impl::VerifyLoweringToCmdPassBase< - VerifyLoweringToCmdPass> { + : IREE::Stream::impl::VerifyLoweringToCmdPassBase { void runOnOperation() override { Verifier verifier; setupDefaultOpLegality(verifier); diff --git a/compiler/src/iree/compiler/Dialect/TensorExt/IR/TensorExtDialect.cpp b/compiler/src/iree/compiler/Dialect/TensorExt/IR/TensorExtDialect.cpp index ec79ff9c2912..11fabec8ccd5 100644 --- a/compiler/src/iree/compiler/Dialect/TensorExt/IR/TensorExtDialect.cpp +++ b/compiler/src/iree/compiler/Dialect/TensorExt/IR/TensorExtDialect.cpp @@ -16,7 +16,7 @@ namespace mlir::iree_compiler::IREE::TensorExt { // Used to control inlining behavior. namespace { -struct IREETensorExtInlinerInterface : public DialectInlinerInterface { +struct IREETensorExtInlinerInterface : DialectInlinerInterface { using DialectInlinerInterface::DialectInlinerInterface; bool isLegalToInline(Operation *call, Operation *callable, diff --git a/compiler/src/iree/compiler/Dialect/TensorExt/IR/TensorExtOpFolders.cpp b/compiler/src/iree/compiler/Dialect/TensorExt/IR/TensorExtOpFolders.cpp index f6f448470206..7e912679446d 100644 --- a/compiler/src/iree/compiler/Dialect/TensorExt/IR/TensorExtOpFolders.cpp +++ b/compiler/src/iree/compiler/Dialect/TensorExt/IR/TensorExtOpFolders.cpp @@ -203,7 +203,7 @@ static bool updateTensorOpDims(RewriterBase &rewriter, Operation *op, } struct ReuseDispatchTensorLoadShapeDims - : public OpRewritePattern { + : OpRewritePattern { using Base::Base; LogicalResult matchAndRewrite(DispatchTensorLoadOp loadOp, PatternRewriter &rewriter) const override { @@ -224,7 +224,7 @@ struct ReuseDispatchTensorLoadShapeDims // // subtensor %v[..] [..] [..] struct ConvertDispatchInputLoadOfTensorToSubTensor - : public OpRewritePattern { + : OpRewritePattern { using Base::Base; LogicalResult matchAndRewrite(DispatchTensorLoadOp loadOp, PatternRewriter &rewriter) const override { @@ -300,7 +300,7 @@ canonicalizeSubViewParts(OpTy op, RankedTensorType sliceType, /// Pattern to rewrite a subview op with constant arguments. struct DispatchTensorLoadOpWithOffsetSizesAndStridesConstantArgumentFolder final - : public OpRewritePattern { + : OpRewritePattern { using Base::Base; LogicalResult matchAndRewrite(DispatchTensorLoadOp loadOp, PatternRewriter &rewriter) const override { @@ -357,7 +357,7 @@ OpFoldResult DispatchTensorLoadOp::fold(FoldAdaptor operands) { namespace { struct ReuseDispatchTensorStoreShapeDims - : public OpRewritePattern { + : OpRewritePattern { using Base::Base; LogicalResult matchAndRewrite(DispatchTensorStoreOp storeOp, PatternRewriter &rewriter) const override { @@ -366,8 +366,7 @@ struct ReuseDispatchTensorStoreShapeDims } }; -struct FoldCastOpIntoDispatchStoreOp - : public OpRewritePattern { +struct FoldCastOpIntoDispatchStoreOp : OpRewritePattern { using Base::Base; LogicalResult matchAndRewrite(DispatchTensorStoreOp storeOp, PatternRewriter &rewriter) const override { @@ -401,7 +400,7 @@ struct FoldCastOpIntoDispatchStoreOp struct DispatchTensorStoreOpWithOffsetSizesAndStridesConstantArgumentFolder final - : public OpRewritePattern { + : OpRewritePattern { using Base::Base; LogicalResult matchAndRewrite(DispatchTensorStoreOp storeOp, PatternRewriter &rewriter) const override { @@ -443,7 +442,7 @@ void DispatchTensorStoreOp::getCanonicalizationPatterns( namespace { // Bubble up the ordinal ops so that all uses go through this operation. -struct BubbleUpOrdinalOp : public OpRewritePattern { +struct BubbleUpOrdinalOp : OpRewritePattern { using Base::Base; LogicalResult matchAndRewrite(DispatchWorkloadOrdinalOp ordinalOp, PatternRewriter &rewriter) const override { diff --git a/compiler/src/iree/compiler/Dialect/TensorExt/IR/TensorExtTypes.h b/compiler/src/iree/compiler/Dialect/TensorExt/IR/TensorExtTypes.h index 553926dfaf8c..266788c63b48 100644 --- a/compiler/src/iree/compiler/Dialect/TensorExt/IR/TensorExtTypes.h +++ b/compiler/src/iree/compiler/Dialect/TensorExt/IR/TensorExtTypes.h @@ -138,7 +138,7 @@ void printType(DispatchTensorType &type, DialectAsmPrinter &p); namespace detail { -struct DispatchTensorTypeStorage : public TypeStorage { +struct DispatchTensorTypeStorage : TypeStorage { DispatchTensorTypeStorage(uint32_t access, Type boundType) : access(access), boundType(boundType) {} diff --git a/compiler/src/iree/compiler/Dialect/TensorExt/Transforms/TestSparseInterfaceMethods.cpp b/compiler/src/iree/compiler/Dialect/TensorExt/Transforms/TestSparseInterfaceMethods.cpp index 7213572a2a8c..a4ab9654f24c 100644 --- a/compiler/src/iree/compiler/Dialect/TensorExt/Transforms/TestSparseInterfaceMethods.cpp +++ b/compiler/src/iree/compiler/Dialect/TensorExt/Transforms/TestSparseInterfaceMethods.cpp @@ -17,7 +17,7 @@ namespace mlir::iree_compiler::IREE::TensorExt { namespace { struct TestSparseOpInterfaceMethodsPass - : public impl::TestSparseOpInterfaceMethodsPassBase< + : impl::TestSparseOpInterfaceMethodsPassBase< TestSparseOpInterfaceMethodsPass> { using Base::Base; diff --git a/compiler/src/iree/compiler/Dialect/Util/Analysis/Attributes/Range.h b/compiler/src/iree/compiler/Dialect/Util/Analysis/Attributes/Range.h index 1258c5a5a237..032e9d2bb40e 100644 --- a/compiler/src/iree/compiler/Dialect/Util/Analysis/Attributes/Range.h +++ b/compiler/src/iree/compiler/Dialect/Util/Analysis/Attributes/Range.h @@ -95,7 +95,7 @@ struct FloatRangeStats { }; // State that tracks floating point ranges and flags. -struct FloatRangeState : public DFX::AbstractState { +struct FloatRangeState : DFX::AbstractState { // Returns the worst possible representable state. static FloatRangeStats getWorstState() { return FloatRangeStats::getWidest(); diff --git a/compiler/src/iree/compiler/Dialect/Util/Analysis/DFX/Element.h b/compiler/src/iree/compiler/Dialect/Util/Analysis/DFX/Element.h index 803feb60958f..be2ab3673fd9 100644 --- a/compiler/src/iree/compiler/Dialect/Util/Analysis/DFX/Element.h +++ b/compiler/src/iree/compiler/Dialect/Util/Analysis/DFX/Element.h @@ -96,7 +96,7 @@ class AbstractElement : public Position, public DepGraphNode { //===----------------------------------------------------------------------===// // An abstract element that represents an operation in the IR. -struct OperationElement : public AbstractElement { +struct OperationElement : AbstractElement { using AbstractElement::AbstractElement; void initialize(Solver &solver) override { @@ -124,7 +124,7 @@ struct OperationElement : public AbstractElement { // An abstract element that represents an operation of type OpT in the IR. template -struct TypedOperationElement : public AbstractElement { +struct TypedOperationElement : AbstractElement { using AbstractElement::AbstractElement; void initialize(Solver &solver) override { @@ -158,7 +158,7 @@ struct TypedOperationElement : public AbstractElement { //===----------------------------------------------------------------------===// // An abstract element that represents a value position in the IR. -struct ValueElement : public AbstractElement { +struct ValueElement : AbstractElement { using AbstractElement::AbstractElement; void initialize(Solver &solver) override { diff --git a/compiler/src/iree/compiler/Dialect/Util/Analysis/DFX/State.h b/compiler/src/iree/compiler/Dialect/Util/Analysis/DFX/State.h index 6f0fa18320ce..6d553ecdeaa5 100644 --- a/compiler/src/iree/compiler/Dialect/Util/Analysis/DFX/State.h +++ b/compiler/src/iree/compiler/Dialect/Util/Analysis/DFX/State.h @@ -76,7 +76,7 @@ struct AbstractState { //===----------------------------------------------------------------------===// template -struct IntegerStateBase : public AbstractState { +struct IntegerStateBase : AbstractState { using base_t = BaseTy; IntegerStateBase() = default; @@ -171,7 +171,7 @@ struct IntegerStateBase : public AbstractState { //===----------------------------------------------------------------------===// // Specialization of the integer state for single-bit values. -struct BooleanState : public IntegerStateBase { +struct BooleanState : IntegerStateBase { using super = IntegerStateBase; using base_t = IntegerStateBase::base_t; @@ -223,8 +223,7 @@ struct BooleanState : public IntegerStateBase { // Specialization of the integer state for a bitwise encoding. template -struct BitIntegerState - : public IntegerStateBase { +struct BitIntegerState : IntegerStateBase { using base_t = BaseTy; // Returns true if the bits set in |BitsEncoding| are "known bits". @@ -288,8 +287,7 @@ struct BitIntegerState // the best state and 0 the worst. template -struct IncIntegerState - : public IntegerStateBase { +struct IncIntegerState : IntegerStateBase { using super = IntegerStateBase; using base_t = BaseTy; @@ -342,7 +340,7 @@ struct IncIntegerState // Specialization of the integer state for a decreasing value, hence 0 is the // best state and ~0u the worst. template -struct DecIntegerState : public IntegerStateBase { +struct DecIntegerState : IntegerStateBase { using base_t = BaseTy; // Takes minimum of known and |value|. @@ -574,11 +572,11 @@ ChangeStatus clampStateAndIndicateChange(StateType &state, // Helper to tie a abstract state implementation to an abstract element. // // Usage: -// struct MyElement : public StateWrapper { +// struct MyElement : StateWrapper { // ... // }; template -struct StateWrapper : public BaseType, public StateTy { +struct StateWrapper : BaseType, StateTy { // Provide static access to the type of the state. using StateType = StateTy; diff --git a/compiler/src/iree/compiler/Dialect/Util/Conversion/ConversionPatterns.cpp b/compiler/src/iree/compiler/Dialect/Util/Conversion/ConversionPatterns.cpp index a7a67fedeae0..7c0e49406b13 100644 --- a/compiler/src/iree/compiler/Dialect/Util/Conversion/ConversionPatterns.cpp +++ b/compiler/src/iree/compiler/Dialect/Util/Conversion/ConversionPatterns.cpp @@ -80,8 +80,7 @@ void populateUtilConversionPatterns(MLIRContext *context, namespace { -struct ConvertInitializerOp - : public OpConversionPattern { +struct ConvertInitializerOp : OpConversionPattern { using Base::Base; LogicalResult matchAndRewrite(IREE::Util::InitializerOp initializerOp, OpAdaptor adaptor, @@ -99,7 +98,7 @@ struct ConvertInitializerOp } }; -struct ConvertFuncOp : public OpConversionPattern { +struct ConvertFuncOp : OpConversionPattern { using Base::Base; LogicalResult matchAndRewrite(IREE::Util::FuncOp funcOp, OpAdaptor adaptor, @@ -142,7 +141,7 @@ struct ConvertFuncOp : public OpConversionPattern { } }; -struct ConvertCallOp : public OpConversionPattern { +struct ConvertCallOp : OpConversionPattern { using Base::Base; LogicalResult matchAndRewrite(IREE::Util::CallOp op, OpAdaptor adaptor, @@ -161,7 +160,7 @@ struct ConvertCallOp : public OpConversionPattern { } }; -struct ConvertReturnOp : public OpConversionPattern { +struct ConvertReturnOp : OpConversionPattern { using Base::Base; LogicalResult matchAndRewrite(IREE::Util::ReturnOp returnOp, OpAdaptor adaptor, @@ -172,7 +171,7 @@ struct ConvertReturnOp : public OpConversionPattern { } }; -struct ConvertFuncFuncOp : public OpConversionPattern { +struct ConvertFuncFuncOp : OpConversionPattern { using Base::Base; LogicalResult matchAndRewrite(mlir::func::FuncOp funcOp, OpAdaptor adaptor, @@ -215,7 +214,7 @@ struct ConvertFuncFuncOp : public OpConversionPattern { } }; -struct ConvertFuncCallOp : public OpConversionPattern { +struct ConvertFuncCallOp : OpConversionPattern { using Base::Base; LogicalResult matchAndRewrite(mlir::func::CallOp op, OpAdaptor adaptor, @@ -231,7 +230,7 @@ struct ConvertFuncCallOp : public OpConversionPattern { } }; -struct ConvertFuncReturnOp : public OpConversionPattern { +struct ConvertFuncReturnOp : OpConversionPattern { using Base::Base; LogicalResult matchAndRewrite(mlir::func::ReturnOp returnOp, OpAdaptor adaptor, @@ -242,7 +241,7 @@ struct ConvertFuncReturnOp : public OpConversionPattern { } }; -struct ConvertBranchOp : public OpConversionPattern { +struct ConvertBranchOp : OpConversionPattern { using Base::Base; LogicalResult matchAndRewrite(mlir::cf::BranchOp op, OpAdaptor adaptor, @@ -253,8 +252,7 @@ struct ConvertBranchOp : public OpConversionPattern { } }; -struct ConvertCondBranchOp - : public OpConversionPattern { +struct ConvertCondBranchOp : OpConversionPattern { using Base::Base; LogicalResult matchAndRewrite(mlir::cf::CondBranchOp op, OpAdaptor adaptor, @@ -267,7 +265,7 @@ struct ConvertCondBranchOp } }; -struct ConvertSwitchOp : public OpConversionPattern { +struct ConvertSwitchOp : OpConversionPattern { using Base::Base; LogicalResult matchAndRewrite(mlir::cf::SwitchOp op, OpAdaptor adaptor, @@ -280,7 +278,7 @@ struct ConvertSwitchOp : public OpConversionPattern { } }; -struct ConvertSelectOp : public OpConversionPattern { +struct ConvertSelectOp : OpConversionPattern { using Base::Base; LogicalResult matchAndRewrite(mlir::arith::SelectOp selectOp, OpAdaptor adaptor, @@ -292,7 +290,7 @@ struct ConvertSelectOp : public OpConversionPattern { } }; -struct ConvertIfOp : public OpConversionPattern { +struct ConvertIfOp : OpConversionPattern { using Base::Base; LogicalResult matchAndRewrite(scf::IfOp ifOp, OpAdaptor adaptor, @@ -317,7 +315,7 @@ struct ConvertIfOp : public OpConversionPattern { } }; -struct ConvertYieldOp : public OpConversionPattern { +struct ConvertYieldOp : OpConversionPattern { using Base::Base; LogicalResult matchAndRewrite(scf::YieldOp yieldOp, OpAdaptor adaptor, diff --git a/compiler/src/iree/compiler/Dialect/Util/Conversion/ConversionPatterns.h b/compiler/src/iree/compiler/Dialect/Util/Conversion/ConversionPatterns.h index 18f39dfea86e..1c013368ccab 100644 --- a/compiler/src/iree/compiler/Dialect/Util/Conversion/ConversionPatterns.h +++ b/compiler/src/iree/compiler/Dialect/Util/Conversion/ConversionPatterns.h @@ -17,7 +17,7 @@ namespace mlir::iree_compiler { template -struct GenericConvertTypesPattern : public OpConversionPattern { +struct GenericConvertTypesPattern : OpConversionPattern { using OpConversionPattern::OpConversionPattern; LogicalResult matchAndRewrite(T op, typename T::Adaptor adaptor, diff --git a/compiler/src/iree/compiler/Dialect/Util/Conversion/FuncToUtil/Patterns.cpp b/compiler/src/iree/compiler/Dialect/Util/Conversion/FuncToUtil/Patterns.cpp index e66e96252bb1..b2a2295b69d8 100644 --- a/compiler/src/iree/compiler/Dialect/Util/Conversion/FuncToUtil/Patterns.cpp +++ b/compiler/src/iree/compiler/Dialect/Util/Conversion/FuncToUtil/Patterns.cpp @@ -20,7 +20,7 @@ namespace mlir::iree_compiler { namespace { -struct FuncFuncOpPattern : public OpConversionPattern { +struct FuncFuncOpPattern : OpConversionPattern { using Base::Base; LogicalResult matchAndRewrite(func::FuncOp srcOp, OpAdaptor adaptor, @@ -124,7 +124,7 @@ struct FuncFuncOpPattern : public OpConversionPattern { } }; -struct FuncCallOpPattern : public OpConversionPattern { +struct FuncCallOpPattern : OpConversionPattern { using Base::Base; LogicalResult matchAndRewrite(func::CallOp srcOp, OpAdaptor adaptor, @@ -143,7 +143,7 @@ struct FuncCallOpPattern : public OpConversionPattern { } }; -struct FuncReturnOpPattern : public OpConversionPattern { +struct FuncReturnOpPattern : OpConversionPattern { using Base::Base; LogicalResult matchAndRewrite(func::ReturnOp srcOp, OpAdaptor adaptor, diff --git a/compiler/src/iree/compiler/Dialect/Util/Conversion/MemRefToUtil/Patterns.cpp b/compiler/src/iree/compiler/Dialect/Util/Conversion/MemRefToUtil/Patterns.cpp index 057d9ce4dfe0..e282accfcd27 100644 --- a/compiler/src/iree/compiler/Dialect/Util/Conversion/MemRefToUtil/Patterns.cpp +++ b/compiler/src/iree/compiler/Dialect/Util/Conversion/MemRefToUtil/Patterns.cpp @@ -87,7 +87,7 @@ static Value getByteLength(OpBuilder &builder, Location loc, /// Pattern to lower operations that become a no-ops at this level. /// Passes through operands to results. template -struct FoldAsNoOp final : public OpConversionPattern { +struct FoldAsNoOp final : OpConversionPattern { using OpConversionPattern::OpConversionPattern; LogicalResult matchAndRewrite(OpTy op, typename OpTy::Adaptor adaptor, @@ -100,7 +100,7 @@ struct FoldAsNoOp final : public OpConversionPattern { /// Pattern to lower operations that become a no-ops at this level. /// Erases the op entirely. template -struct ElideNoOp final : public OpConversionPattern { +struct ElideNoOp final : OpConversionPattern { using OpConversionPattern::OpConversionPattern; LogicalResult matchAndRewrite(OpTy op, typename OpTy::Adaptor adaptor, @@ -110,7 +110,7 @@ struct ElideNoOp final : public OpConversionPattern { } }; -struct ConvertMemRefGlobalOp : public OpConversionPattern { +struct ConvertMemRefGlobalOp : OpConversionPattern { using Base::Base; LogicalResult matchAndRewrite(memref::GlobalOp globalOp, OpAdaptor adaptor, @@ -154,8 +154,7 @@ struct ConvertMemRefGlobalOp : public OpConversionPattern { } }; -struct ConvertMemRefGetGlobalOp - : public OpConversionPattern { +struct ConvertMemRefGetGlobalOp : OpConversionPattern { using Base::Base; LogicalResult matchAndRewrite(memref::GetGlobalOp getOp, OpAdaptor adaptor, @@ -170,7 +169,7 @@ struct ConvertMemRefGetGlobalOp } }; -struct ConvertMemRefAllocaOp : public OpConversionPattern { +struct ConvertMemRefAllocaOp : OpConversionPattern { using Base::Base; LogicalResult matchAndRewrite(memref::AllocaOp allocaOp, OpAdaptor adaptor, @@ -185,7 +184,7 @@ struct ConvertMemRefAllocaOp : public OpConversionPattern { } }; -struct ConvertMemRefDimOp : public OpConversionPattern { +struct ConvertMemRefDimOp : OpConversionPattern { using Base::Base; LogicalResult matchAndRewrite(memref::DimOp dimOp, OpAdaptor adaptor, @@ -206,7 +205,7 @@ struct ConvertMemRefDimOp : public OpConversionPattern { } }; -struct ConvertMemRefLoadOp : public OpConversionPattern { +struct ConvertMemRefLoadOp : OpConversionPattern { using Base::Base; LogicalResult matchAndRewrite(memref::LoadOp loadOp, OpAdaptor adaptor, @@ -245,7 +244,7 @@ struct ConvertMemRefLoadOp : public OpConversionPattern { } }; -struct ConvertMemRefStoreOp : public OpConversionPattern { +struct ConvertMemRefStoreOp : OpConversionPattern { using Base::Base; LogicalResult matchAndRewrite(memref::StoreOp storeOp, OpAdaptor adaptor, @@ -284,7 +283,7 @@ struct ConvertMemRefStoreOp : public OpConversionPattern { // Make `reinterpret_cast` a no-op. struct ConvertMemRefReinterpretCastOp - : public OpConversionPattern { + : OpConversionPattern { using Base::Base; LogicalResult diff --git a/compiler/src/iree/compiler/Dialect/Util/IR/UtilAttrs.cpp b/compiler/src/iree/compiler/Dialect/Util/IR/UtilAttrs.cpp index f6c8d5afd1bd..8f2859f9f7f7 100644 --- a/compiler/src/iree/compiler/Dialect/Util/IR/UtilAttrs.cpp +++ b/compiler/src/iree/compiler/Dialect/Util/IR/UtilAttrs.cpp @@ -705,8 +705,8 @@ int64_t UninitializedAttr::getStorageSize() const { //===----------------------------------------------------------------------===// struct SizedStorageDenseElementsAttrModel - : public SizedStorageAttr::ExternalModel { + : SizedStorageAttr::ExternalModel { int64_t getStorageSize(Attribute baseAttr) const { auto attr = cast(baseAttr); return IREE::Util::getRoundedPhysicalStorageSize( @@ -716,7 +716,7 @@ struct SizedStorageDenseElementsAttrModel }; struct SizedStorageDenseResourceElementsAttrModel - : public SizedStorageAttr::ExternalModel< + : SizedStorageAttr::ExternalModel< SizedStorageDenseResourceElementsAttrModel, DenseResourceElementsAttr> { int64_t getStorageSize(Attribute baseAttr) const { @@ -728,8 +728,7 @@ struct SizedStorageDenseResourceElementsAttrModel // We don't include NUL terminators as it's 2023. struct SizedStorageStringAttrModel - : public SizedStorageAttr::ExternalModel { + : SizedStorageAttr::ExternalModel { int64_t getStorageSize(Attribute baseAttr) const { auto attr = cast(baseAttr); return attr.getValue().size(); @@ -743,7 +742,7 @@ struct SizedStorageStringAttrModel // External interface applied to ElementsAttrs so that we can serialize them to // byte buffers. struct SerializableDenseElementsAttrModel - : public SerializableAttrInterface::ExternalModel< + : SerializableAttrInterface::ExternalModel< SerializableDenseElementsAttrModel, DenseIntOrFPElementsAttr> { LogicalResult serializeToVector(Attribute baseAttr, Location loc, llvm::endianness endian, @@ -789,7 +788,7 @@ struct SerializableDenseElementsAttrModel // External interface applied to ElementsAttrs so that we can serialize them to // byte buffers. struct SerializableDenseResourceElementsAttrModel - : public SerializableAttrInterface::ExternalModel< + : SerializableAttrInterface::ExternalModel< SerializableDenseResourceElementsAttrModel, DenseResourceElementsAttr> { LogicalResult serializeToVector(Attribute baseAttr, Location loc, @@ -837,8 +836,8 @@ struct SerializableDenseResourceElementsAttrModel // External interface applied to string attrs so that we can serialize them to // byte buffers. We don't include NUL terminators as it's 2022. struct SerializableStringAttrModel - : public SerializableAttrInterface::ExternalModel< - SerializableStringAttrModel, StringAttr> { + : SerializableAttrInterface::ExternalModel { LogicalResult serializeToVector(Attribute baseAttr, Location loc, llvm::endianness endian, SmallVectorImpl &buffer) const { diff --git a/compiler/src/iree/compiler/Dialect/Util/IR/UtilDialect.cpp b/compiler/src/iree/compiler/Dialect/Util/IR/UtilDialect.cpp index bc82b7a4c1de..2b3370efb6b7 100644 --- a/compiler/src/iree/compiler/Dialect/Util/IR/UtilDialect.cpp +++ b/compiler/src/iree/compiler/Dialect/Util/IR/UtilDialect.cpp @@ -28,7 +28,7 @@ namespace mlir::iree_compiler::IREE::Util { // Used for custom printing support. -struct UtilOpAsmInterface : public OpAsmDialectInterface { +struct UtilOpAsmInterface : OpAsmDialectInterface { using OpAsmDialectInterface::OpAsmDialectInterface; /// Hooks for getting an alias identifier alias for a given symbol, that is /// not necessarily a part of this dialect. The identifier is used in place of @@ -45,7 +45,7 @@ struct UtilOpAsmInterface : public OpAsmDialectInterface { }; // Used to control inlining behavior. -struct UtilInlinerInterface : public DialectInlinerInterface { +struct UtilInlinerInterface : DialectInlinerInterface { using DialectInlinerInterface::DialectInlinerInterface; bool isLegalToInline(Operation *call, Operation *callable, @@ -153,7 +153,7 @@ Operation *UtilDialect::materializeConstant(OpBuilder &builder, Attribute value, } template -struct FoldDimOp : public OpRewritePattern { +struct FoldDimOp : OpRewritePattern { using OpRewritePattern::OpRewritePattern; LogicalResult matchAndRewrite(DimOp op, PatternRewriter &rewriter) const override { diff --git a/compiler/src/iree/compiler/Dialect/Util/IR/UtilOpFolders.cpp b/compiler/src/iree/compiler/Dialect/Util/IR/UtilOpFolders.cpp index 8e2cf74b74b2..ff36d1240ded 100644 --- a/compiler/src/iree/compiler/Dialect/Util/IR/UtilOpFolders.cpp +++ b/compiler/src/iree/compiler/Dialect/Util/IR/UtilOpFolders.cpp @@ -211,7 +211,7 @@ static ArrayAttr getZippedAssumeRange(Builder &b, ArrayAttr l, ArrayAttr r) { namespace { /// Deduplicates operands, merging assume ranges along the way. -struct DeduplicateOperands : public OpRewritePattern { +struct DeduplicateOperands : OpRewritePattern { using Base::Base; LogicalResult matchAndRewrite(AssumeIntOp op, PatternRewriter &rewriter) const override { @@ -273,7 +273,7 @@ struct DeduplicateOperands : public OpRewritePattern { /// %2 = arith.muli %1, X /// /// Where X | Y. -struct FoldDivMulOfAssume : public OpRewritePattern { +struct FoldDivMulOfAssume : OpRewritePattern { using Base::Base; LogicalResult matchAndRewrite(arith::MulIOp mulOp, PatternRewriter &rewriter) const override { @@ -347,7 +347,7 @@ namespace { /// Folds cast ops into the result of other ops. /// Only safe to apply to ops that don't care about their types. -struct FoldCastIntoNullOp : public OpRewritePattern { +struct FoldCastIntoNullOp : OpRewritePattern { using Base::Base; LogicalResult matchAndRewrite(CastOp castOp, PatternRewriter &rewriter) const override { @@ -456,7 +456,7 @@ namespace { // -> // %min = arith.minui %0, %1 : index template -struct ExpandSimpleRangeOp : public OpRewritePattern { +struct ExpandSimpleRangeOp : OpRewritePattern { using OpRewritePattern::OpRewritePattern; LogicalResult matchAndRewrite(RangeOpT op, PatternRewriter &rewriter) const override { @@ -479,7 +479,7 @@ struct ExpandSimpleRangeOp : public OpRewritePattern { // -> // %min = util.range.min %c1, %0, %1 template -struct SimplifyUniformRangeOp : public OpRewritePattern { +struct SimplifyUniformRangeOp : OpRewritePattern { using OpRewritePattern::OpRewritePattern; LogicalResult matchAndRewrite(OpT op, PatternRewriter &rewriter) const override { @@ -545,7 +545,7 @@ static Value makeRangeEnd(Location loc, Value offset, Value length, namespace { -struct FoldConstantRanges : public OpRewritePattern { +struct FoldConstantRanges : OpRewritePattern { using Base::Base; LogicalResult matchAndRewrite(RangeExtentsOp op, PatternRewriter &rewriter) const override { @@ -609,7 +609,7 @@ struct FoldConstantRanges : public OpRewritePattern { } }; -struct ExpandSimpleRangeExtentsOp : public OpRewritePattern { +struct ExpandSimpleRangeExtentsOp : OpRewritePattern { using Base::Base; LogicalResult matchAndRewrite(RangeExtentsOp op, PatternRewriter &rewriter) const override { @@ -641,7 +641,7 @@ struct ExpandSimpleRangeExtentsOp : public OpRewritePattern { } }; -struct DeduplicateRangeExtentsOp : public OpRewritePattern { +struct DeduplicateRangeExtentsOp : OpRewritePattern { using Base::Base; LogicalResult matchAndRewrite(RangeExtentsOp op, PatternRewriter &rewriter) const override { @@ -859,7 +859,7 @@ static bool inSingleBlockSCFRegion(Operation *op) { // to clean up what it produces. It may also be introduced by SCF simplification // patterns that are always applied. struct ConvertSCFUnreachableToTerminatorOp - : public OpRewritePattern { + : OpRewritePattern { using OpRewritePattern::OpRewritePattern; LogicalResult matchAndRewrite(SCFUnreachableOp op, PatternRewriter &rewriter) const override { @@ -905,7 +905,7 @@ struct ConvertSCFUnreachableToTerminatorOp // Pattern to handle util.scf.unreachable inside single-block SCF regions by // erasing subsequent operations and creating poison values. struct SimplifySCFUnreachableInSCFRegionOp - : public OpRewritePattern { + : OpRewritePattern { using OpRewritePattern::OpRewritePattern; LogicalResult matchAndRewrite(SCFUnreachableOp op, PatternRewriter &rewriter) const override { @@ -970,8 +970,7 @@ void SCFUnreachableOp::getCanonicalizationPatterns(RewritePatternSet &results, namespace { -struct ExpandUnfoldableConstantOp - : public OpRewritePattern { +struct ExpandUnfoldableConstantOp : OpRewritePattern { using Base::Base; LogicalResult matchAndRewrite(UnfoldableConstantOp op, PatternRewriter &rewriter) const override { @@ -997,7 +996,7 @@ void UnfoldableConstantOp::getCanonicalizationPatterns( namespace { // Deletes empty vm.initializer ops. -struct DropEmptyInitializerOp : public OpRewritePattern { +struct DropEmptyInitializerOp : OpRewritePattern { using Base::Base; LogicalResult matchAndRewrite(InitializerOp op, @@ -1030,7 +1029,7 @@ namespace { /// Turns util.global.address -> util.global.load.indirect into a direct load. template -struct PropagateGlobalLoadAddress : public OpRewritePattern { +struct PropagateGlobalLoadAddress : OpRewritePattern { using OpRewritePattern::OpRewritePattern; LogicalResult matchAndRewrite(IndirectOpT op, PatternRewriter &rewriter) const override { @@ -1059,7 +1058,7 @@ namespace { /// This can happen if there was a global load, some DCE'd usage, and a /// store back to the same global: we want to be able to elide the entire load /// and store. -struct EraseUnusedGlobalStoreOp : public OpRewritePattern { +struct EraseUnusedGlobalStoreOp : OpRewritePattern { using Base::Base; LogicalResult matchAndRewrite(GlobalStoreOp op, @@ -1134,7 +1133,7 @@ namespace { // Folds subspan -> subspan to point at the original source buffer with an // updated range. -struct FoldBufferSubspanOps : public OpRewritePattern { +struct FoldBufferSubspanOps : OpRewritePattern { using Base::Base; LogicalResult matchAndRewrite(BufferSubspanOp op, PatternRewriter &rewriter) const override { @@ -1162,8 +1161,7 @@ struct FoldBufferSubspanOps : public OpRewritePattern { // -> // %new_offset = arith.addi %offset, %subspan_offset // util.buffer.copy %src[%new_offset], %dst[%new_offset], %subspan_length -struct FoldBufferSubspanOpsIntoConsumers - : public OpRewritePattern { +struct FoldBufferSubspanOpsIntoConsumers : OpRewritePattern { using Base::Base; LogicalResult matchAndRewrite(BufferSubspanOp op, PatternRewriter &rewriter) const override { @@ -1201,8 +1199,7 @@ struct FoldBufferSubspanOpsIntoConsumers // -> // %offset = select %cond, %offset0, %offset1 : index // %subspan = util.buffer.subspan %src[%offset] -struct SinkSubspanAcrossSelectOps - : public OpRewritePattern { +struct SinkSubspanAcrossSelectOps : OpRewritePattern { using Base::Base; LogicalResult matchAndRewrite(mlir::arith::SelectOp op, PatternRewriter &rewriter) const override { @@ -1285,7 +1282,7 @@ namespace { // -> // %c = select %cond, %a, %b : !util.buffer // %c_sz = select %cond, %a_sz, %b_sz : index -struct SelectBufferSizeOp : public OpRewritePattern { +struct SelectBufferSizeOp : OpRewritePattern { using Base::Base; LogicalResult matchAndRewrite(BufferSizeOp op, PatternRewriter &rewriter) const override { @@ -1324,7 +1321,7 @@ namespace { // -> // %storage, %raw_offset = util.buffer.storage %src // %offset = arith.addi %raw_offset, %subspan_offset -struct FoldSubspansIntoStorageOp : public OpRewritePattern { +struct FoldSubspansIntoStorageOp : OpRewritePattern { using Base::Base; LogicalResult matchAndRewrite(BufferStorageOp op, PatternRewriter &rewriter) const override { @@ -1513,7 +1510,7 @@ namespace { // When all arguments are constant, replaces the op with a buffer constant. // When some arguments are constant, merges them into the format string and // produces a new format op with fewer arguments. -struct PartialFoldStringFormat : public OpRewritePattern { +struct PartialFoldStringFormat : OpRewritePattern { using Base::Base; LogicalResult matchAndRewrite(StringFormatOp op, PatternRewriter &rewriter) const override { @@ -1624,7 +1621,7 @@ struct PartialFoldStringFormat : public OpRewritePattern { // Eliminates identity format operations: util.string.format "{}"(%buf) -> %buf. // When the format string contains only a single placeholder with no surrounding // text and the argument is a buffer, the format is a no-op. -struct EliminateIdentityFormat : public OpRewritePattern { +struct EliminateIdentityFormat : OpRewritePattern { using Base::Base; LogicalResult matchAndRewrite(StringFormatOp op, PatternRewriter &rewriter) const override { @@ -1674,7 +1671,7 @@ struct EliminateIdentityFormat : public OpRewritePattern { // Simplifies single-integer-argument format to itoa: // util.string.format "{}"(%num) -> util.string.itoa %num. // More direct and itoa is simpler than format. -struct SimplifySingleIntFormatToItoa : public OpRewritePattern { +struct SimplifySingleIntFormatToItoa : OpRewritePattern { using Base::Base; LogicalResult matchAndRewrite(StringFormatOp op, PatternRewriter &rewriter) const override { @@ -1725,7 +1722,7 @@ struct SimplifySingleIntFormatToItoa : public OpRewritePattern { // This handles explicit ordinals ("{0} {1}"), out-of-order ("{1} {0}"), and // duplicates ("{0} {0}") even when all arguments are dynamic (which means // PartialFoldStringFormat won't trigger). -struct NormalizeFormatOrdinals : public OpRewritePattern { +struct NormalizeFormatOrdinals : OpRewritePattern { using Base::Base; LogicalResult matchAndRewrite(StringFormatOp op, PatternRewriter &rewriter) const override { @@ -1811,7 +1808,7 @@ namespace { // Folds itoa through zero-extending casts (extui, index_cast to wider type). // Since itoa produces unsigned decimal representation, zero-extension doesn't // change the string output, so we can fold through the cast. -struct FoldItoaThroughZeroExtend : public OpRewritePattern { +struct FoldItoaThroughZeroExtend : OpRewritePattern { using Base::Base; LogicalResult matchAndRewrite(StringItoaOp op, PatternRewriter &rewriter) const override { diff --git a/compiler/src/iree/compiler/Dialect/Util/IR/UtilTraits.h b/compiler/src/iree/compiler/Dialect/Util/IR/UtilTraits.h index ff71133bf5a3..717db7b790d5 100644 --- a/compiler/src/iree/compiler/Dialect/Util/IR/UtilTraits.h +++ b/compiler/src/iree/compiler/Dialect/Util/IR/UtilTraits.h @@ -13,7 +13,7 @@ namespace mlir::OpTrait::IREE::Util { template -struct YieldPoint : public OpTrait::TraitBase { +struct YieldPoint : OpTrait::TraitBase { static LogicalResult verifyTrait(Operation *op) { // TODO(benvanik): verify yield point. return success(); @@ -21,7 +21,7 @@ struct YieldPoint : public OpTrait::TraitBase { }; template -struct Unsafe : public OpTrait::TraitBase { +struct Unsafe : OpTrait::TraitBase { static LogicalResult verifyTrait(Operation *op) { // TODO(benvanik): verify that entire tree is marked unsafe. return success(); @@ -29,7 +29,7 @@ struct Unsafe : public OpTrait::TraitBase { }; template -struct DebugOnly : public OpTrait::TraitBase { +struct DebugOnly : OpTrait::TraitBase { // TODO(benvanik): helper for eliding safely on ops that return values. static LogicalResult verifyTrait(Operation *op) { return success(); } @@ -37,13 +37,12 @@ struct DebugOnly : public OpTrait::TraitBase { template struct ImplicitlyCaptured - : public OpTrait::TraitBase { + : OpTrait::TraitBase { static LogicalResult verifyTrait(Operation *op) { return success(); } }; template -struct UnreachableLike - : public OpTrait::TraitBase { +struct UnreachableLike : OpTrait::TraitBase { static LogicalResult verifyTrait(Operation *op) { // Unreachable ops mark code as not reachable at runtime. // No specific verification needed at this time. @@ -52,7 +51,7 @@ struct UnreachableLike }; template -struct ObjectLike : public OpTrait::TraitBase { +struct ObjectLike : OpTrait::TraitBase { static LogicalResult verifyTrait(Operation *op) { if (!op->hasTrait() || !op->hasTrait()) { diff --git a/compiler/src/iree/compiler/Dialect/Util/Transforms/AttributeCallGraph.cpp b/compiler/src/iree/compiler/Dialect/Util/Transforms/AttributeCallGraph.cpp index 3faa57de2e3a..09d204946201 100644 --- a/compiler/src/iree/compiler/Dialect/Util/Transforms/AttributeCallGraph.cpp +++ b/compiler/src/iree/compiler/Dialect/Util/Transforms/AttributeCallGraph.cpp @@ -24,7 +24,7 @@ static void propagateAttribute(Operation *from, Operation *to, StringRef name) { } struct AttributeCallGraphPass - : public impl::AttributeCallGraphPassBase { + : impl::AttributeCallGraphPassBase { void runOnOperation() override { auto moduleOp = getOperation(); SymbolTable symbolTable(moduleOp); diff --git a/compiler/src/iree/compiler/Dialect/Util/Transforms/CombineInitializers.cpp b/compiler/src/iree/compiler/Dialect/Util/Transforms/CombineInitializers.cpp index 42c8bb4c3425..115125e33759 100644 --- a/compiler/src/iree/compiler/Dialect/Util/Transforms/CombineInitializers.cpp +++ b/compiler/src/iree/compiler/Dialect/Util/Transforms/CombineInitializers.cpp @@ -125,7 +125,7 @@ collectTransitiveGlobalDeps(IREE::Util::InitializerOpInterface initOp, } struct CombineInitializersPass - : public impl::CombineInitializersPassBase { + : impl::CombineInitializersPassBase { void runOnOperation() override { mlir::ModuleOp moduleOp = getOperation(); diff --git a/compiler/src/iree/compiler/Dialect/Util/Transforms/DropCompilerHints.cpp b/compiler/src/iree/compiler/Dialect/Util/Transforms/DropCompilerHints.cpp index dfa3fdeaade2..33235775bcaa 100644 --- a/compiler/src/iree/compiler/Dialect/Util/Transforms/DropCompilerHints.cpp +++ b/compiler/src/iree/compiler/Dialect/Util/Transforms/DropCompilerHints.cpp @@ -18,7 +18,7 @@ namespace mlir::iree_compiler::IREE::Util { namespace { struct DropCompilerHintsPass - : public impl::DropCompilerHintsPassBase { + : impl::DropCompilerHintsPassBase { using Base::Base; void runOnOperation() override { diff --git a/compiler/src/iree/compiler/Dialect/Util/Transforms/DumpModule.cpp b/compiler/src/iree/compiler/Dialect/Util/Transforms/DumpModule.cpp index 10025062d399..9c4f7aaf298d 100644 --- a/compiler/src/iree/compiler/Dialect/Util/Transforms/DumpModule.cpp +++ b/compiler/src/iree/compiler/Dialect/Util/Transforms/DumpModule.cpp @@ -21,7 +21,7 @@ namespace mlir::iree_compiler::IREE::Util { namespace { -struct DumpModulePass : public impl::DumpModulePassBase { +struct DumpModulePass : impl::DumpModulePassBase { using Base::Base; void runOnOperation() override { diff --git a/compiler/src/iree/compiler/Dialect/Util/Transforms/FoldGlobals.cpp b/compiler/src/iree/compiler/Dialect/Util/Transforms/FoldGlobals.cpp index d9445ff64007..e1efb93fab66 100644 --- a/compiler/src/iree/compiler/Dialect/Util/Transforms/FoldGlobals.cpp +++ b/compiler/src/iree/compiler/Dialect/Util/Transforms/FoldGlobals.cpp @@ -380,7 +380,7 @@ static bool deduplicateConstantGlobals(GlobalTable &globalTable) { return true; // did change } -struct FoldGlobalsPass : public impl::FoldGlobalsPassBase { +struct FoldGlobalsPass : impl::FoldGlobalsPassBase { void runOnOperation() override { auto *context = &getContext(); RewritePatternSet patterns(context); diff --git a/compiler/src/iree/compiler/Dialect/Util/Transforms/LiftCFGToSCF.cpp b/compiler/src/iree/compiler/Dialect/Util/Transforms/LiftCFGToSCF.cpp index 3443ea7c9781..81ef477eea95 100644 --- a/compiler/src/iree/compiler/Dialect/Util/Transforms/LiftCFGToSCF.cpp +++ b/compiler/src/iree/compiler/Dialect/Util/Transforms/LiftCFGToSCF.cpp @@ -32,7 +32,7 @@ namespace { // Similar to the upstream variant but supports our unreachable ops, does not // assume the `func` dialect is used, and can be used to support custom // behavior like tied operands. -struct UtilToSCFInterface : public mlir::CFGToSCFInterface { +struct UtilToSCFInterface : mlir::CFGToSCFInterface { // Creates scf.if or scf.index_switch for structured branches. FailureOr createStructuredBranchRegionOp( OpBuilder &builder, Operation *controlFlowCondOp, TypeRange resultTypes, diff --git a/compiler/src/iree/compiler/Dialect/Util/Transforms/LinkModules.cpp b/compiler/src/iree/compiler/Dialect/Util/Transforms/LinkModules.cpp index bb953f60923b..75c9f75e1ef5 100644 --- a/compiler/src/iree/compiler/Dialect/Util/Transforms/LinkModules.cpp +++ b/compiler/src/iree/compiler/Dialect/Util/Transforms/LinkModules.cpp @@ -840,7 +840,7 @@ LogicalResult ModuleLinker::link(ModuleOp targetModule) { // LinkModulesPass //===----------------------------------------------------------------------===// -struct LinkModulesPass : public impl::LinkModulesPassBase { +struct LinkModulesPass : impl::LinkModulesPassBase { using Base::Base; void runOnOperation() override { ModuleOp targetModule = getOperation(); diff --git a/compiler/src/iree/compiler/Dialect/Util/Transforms/OptimizeIntArithmetic.cpp b/compiler/src/iree/compiler/Dialect/Util/Transforms/OptimizeIntArithmetic.cpp index e43b56fbad7b..bb4e6116e69f 100644 --- a/compiler/src/iree/compiler/Dialect/Util/Transforms/OptimizeIntArithmetic.cpp +++ b/compiler/src/iree/compiler/Dialect/Util/Transforms/OptimizeIntArithmetic.cpp @@ -93,7 +93,7 @@ staticallyLegalToConvertToUnsignedOp(DataFlowSolver &solver, Operation *op) { } template -struct ConvertOpToUnsigned : public OpRewritePattern { +struct ConvertOpToUnsigned : OpRewritePattern { ConvertOpToUnsigned(MLIRContext *context, DataFlowSolver &solver) : OpRewritePattern(context), solver(solver) {} @@ -127,7 +127,7 @@ struct ConvertOpToUnsigned : public OpRewritePattern { // %5 = arith.addi %3, %4 : index // struct ConvertUnsignedI64IndexCastProducerToIndex - : public OpRewritePattern { + : OpRewritePattern { ConvertUnsignedI64IndexCastProducerToIndex(MLIRContext *context, DataFlowSolver &solver) : OpRewritePattern(context), solver(solver) {} @@ -202,8 +202,7 @@ struct ConvertUnsignedI64IndexCastProducerToIndex // introduces unnecessary zero-extensions and truncations to/from `index` // when introducing assumptions. //===----------------------------------------------------------------------===// -struct RemoveIndexCastForAssumeOfI32 - : public OpRewritePattern { +struct RemoveIndexCastForAssumeOfI32 : OpRewritePattern { RemoveIndexCastForAssumeOfI32(MLIRContext *context, DataFlowSolver &solver) : OpRewritePattern(context), solver(solver) {} @@ -269,7 +268,7 @@ struct RemoveIndexCastForAssumeOfI32 // If the induction variable of an scf.for can be represented as an I32, // make that change to save on registers etc. //===----------------------------------------------------------------------===// -struct NarrowSCFForIvToI32 : public OpRewritePattern { +struct NarrowSCFForIvToI32 : OpRewritePattern { NarrowSCFForIvToI32(MLIRContext *context, DataFlowSolver &solver) : OpRewritePattern(context), solver(solver) {} @@ -348,7 +347,7 @@ static LogicalResult getDivisibility(DataFlowSolver &solver, Operation *op, return success(); } -struct RemUIDivisibilityByConstant : public OpRewritePattern { +struct RemUIDivisibilityByConstant : OpRewritePattern { RemUIDivisibilityByConstant(MLIRContext *context, DataFlowSolver &solver) : OpRewritePattern(context), solver(solver) {} @@ -411,7 +410,7 @@ void expandAffineOps(Operation *rootOp) { // General optimization patterns //===----------------------------------------------------------------------===// -struct ElideTruncOfIndexCast : public OpRewritePattern { +struct ElideTruncOfIndexCast : OpRewritePattern { using Base::Base; LogicalResult matchAndRewrite(arith::TruncIOp truncOp, diff --git a/compiler/src/iree/compiler/Dialect/Util/Transforms/Patterns.cpp b/compiler/src/iree/compiler/Dialect/Util/Transforms/Patterns.cpp index 9a7d2785ab33..995edf911caa 100644 --- a/compiler/src/iree/compiler/Dialect/Util/Transforms/Patterns.cpp +++ b/compiler/src/iree/compiler/Dialect/Util/Transforms/Patterns.cpp @@ -114,7 +114,7 @@ static void inlineSCFBlockAndReplaceOp(PatternRewriter &rewriter, Block &block, // br ^bb1(%0 : index) // ^bb1(%arg0: index): // %arg1 remapped to %arg0 struct FoldBlockArgumentsPattern - : public OpInterfaceRewritePattern { + : OpInterfaceRewritePattern { using OpInterfaceRewritePattern::OpInterfaceRewritePattern; LogicalResult matchAndRewrite(CallableOpInterface op, PatternRewriter &rewriter) const override { @@ -263,7 +263,7 @@ struct FoldBlockArgumentsPattern // br ^bb1 // ^bb1: // %0 remapped to %arg0 struct ElideBranchOperandsPattern - : public OpInterfaceRewritePattern { + : OpInterfaceRewritePattern { using OpInterfaceRewritePattern::OpInterfaceRewritePattern; LogicalResult matchAndRewrite(CallableOpInterface op, PatternRewriter &rewriter) const override { @@ -413,7 +413,7 @@ struct ElideBranchOperandsPattern // %default = ... // scf.yield %default : i32 // } -struct IndexSwitchToIfPattern : public OpRewritePattern { +struct IndexSwitchToIfPattern : OpRewritePattern { using Base::Base; LogicalResult matchAndRewrite(scf::IndexSwitchOp switchOp, PatternRewriter &rewriter) const override { @@ -475,7 +475,7 @@ struct IndexSwitchToIfPattern : public OpRewritePattern { // bar_default // scf.yield // } -struct MergeIndexSwitchPattern : public OpRewritePattern { +struct MergeIndexSwitchPattern : OpRewritePattern { MergeIndexSwitchPattern(MLIRContext *context) : OpRewritePattern(context, 1000) {} LogicalResult matchAndRewrite(scf::IndexSwitchOp nextOp, @@ -600,7 +600,7 @@ struct MergeIndexSwitchPattern : public OpRewritePattern { // // TODO: add assertion that !%cond when we have util.assume.* propagation // // to indicate that the opposite of `%cond` is true. // "some.op"() : () -> () -struct SimplifyIfWithUnreachablePattern : public OpRewritePattern { +struct SimplifyIfWithUnreachablePattern : OpRewritePattern { using OpRewritePattern::OpRewritePattern; LogicalResult matchAndRewrite(scf::IfOp ifOp, PatternRewriter &rewriter) const override { @@ -667,8 +667,7 @@ struct SimplifyIfWithUnreachablePattern : public OpRewritePattern { }; // Simplifies scf.while when the body contains unreachable. -struct SimplifyWhileWithUnreachablePattern - : public OpRewritePattern { +struct SimplifyWhileWithUnreachablePattern : OpRewritePattern { using OpRewritePattern::OpRewritePattern; LogicalResult matchAndRewrite(scf::WhileOp whileOp, PatternRewriter &rewriter) const override { @@ -713,7 +712,7 @@ struct SimplifyWhileWithUnreachablePattern // Simplifies scf.index_switch when cases contain unreachable. struct SimplifyIndexSwitchWithUnreachablePattern - : public OpRewritePattern { + : OpRewritePattern { using OpRewritePattern::OpRewritePattern; LogicalResult matchAndRewrite(scf::IndexSwitchOp switchOp, PatternRewriter &rewriter) const override { @@ -801,7 +800,7 @@ struct SimplifyIndexSwitchWithUnreachablePattern }; // Simplifies scf.for when the body contains unreachable. -struct SimplifyForWithUnreachablePattern : public OpRewritePattern { +struct SimplifyForWithUnreachablePattern : OpRewritePattern { using OpRewritePattern::OpRewritePattern; LogicalResult matchAndRewrite(scf::ForOp forOp, PatternRewriter &rewriter) const override { @@ -833,8 +832,7 @@ struct SimplifyForWithUnreachablePattern : public OpRewritePattern { // Simplifies unconditional branches to blocks that are unreachable. // This is likely to happen via other patterns but we preserve this for defense. -struct SimplifyBranchToUnreachablePattern - : public OpRewritePattern { +struct SimplifyBranchToUnreachablePattern : OpRewritePattern { using OpRewritePattern::OpRewritePattern; LogicalResult matchAndRewrite(cf::BranchOp branchOp, PatternRewriter &rewriter) const override { @@ -864,7 +862,7 @@ struct SimplifyBranchToUnreachablePattern // │ reachable │ unreachable │ cf.br ^true │ // └─────────────────┴─────────────────┴──────────────────────┘ struct SimplifyCondBranchToUnreachablePattern - : public OpRewritePattern { + : OpRewritePattern { using OpRewritePattern::OpRewritePattern; LogicalResult matchAndRewrite(cf::CondBranchOp condBr, PatternRewriter &rewriter) const override { diff --git a/compiler/src/iree/compiler/Dialect/Util/Transforms/VerifyStructuredControlFlow.cpp b/compiler/src/iree/compiler/Dialect/Util/Transforms/VerifyStructuredControlFlow.cpp index ae691c1828c6..003b75cdd7dd 100644 --- a/compiler/src/iree/compiler/Dialect/Util/Transforms/VerifyStructuredControlFlow.cpp +++ b/compiler/src/iree/compiler/Dialect/Util/Transforms/VerifyStructuredControlFlow.cpp @@ -18,7 +18,7 @@ namespace mlir::iree_compiler::IREE::Util { namespace { struct VerifyStructuredControlFlowPass - : public impl::VerifyStructuredControlFlowPassBase< + : impl::VerifyStructuredControlFlowPassBase< VerifyStructuredControlFlowPass> { using Base::Base; void runOnOperation() override { diff --git a/compiler/src/iree/compiler/Dialect/VM/Conversion/ArithToVM/Patterns.cpp b/compiler/src/iree/compiler/Dialect/VM/Conversion/ArithToVM/Patterns.cpp index 86d037bd439e..a4a9450ced0b 100644 --- a/compiler/src/iree/compiler/Dialect/VM/Conversion/ArithToVM/Patterns.cpp +++ b/compiler/src/iree/compiler/Dialect/VM/Conversion/ArithToVM/Patterns.cpp @@ -25,7 +25,7 @@ namespace mlir::iree_compiler { namespace { -struct ConstantOpConversion : public OpConversionPattern { +struct ConstantOpConversion : OpConversionPattern { TypeConverter &typeConverter; ConstantOpConversion(MLIRContext *context, TypeConverter &typeConverter) : OpConversionPattern(context), typeConverter(typeConverter) {} @@ -96,7 +96,7 @@ struct ConstantOpConversion : public OpConversionPattern { } }; -struct CmpI32OpConversion : public OpConversionPattern { +struct CmpI32OpConversion : OpConversionPattern { using Base::Base; LogicalResult matchAndRewrite(arith::CmpIOp srcOp, OpAdaptor adaptor, @@ -152,7 +152,7 @@ struct CmpI32OpConversion : public OpConversionPattern { } }; -struct CmpI64OpConversion : public OpConversionPattern { +struct CmpI64OpConversion : OpConversionPattern { using Base::Base; LogicalResult matchAndRewrite(arith::CmpIOp srcOp, OpAdaptor adaptor, @@ -208,7 +208,7 @@ struct CmpI64OpConversion : public OpConversionPattern { } }; -struct CmpF32OpConversion : public OpConversionPattern { +struct CmpF32OpConversion : OpConversionPattern { using Base::Base; LogicalResult matchAndRewrite(arith::CmpFOp srcOp, OpAdaptor adaptor, @@ -299,7 +299,7 @@ struct CmpF32OpConversion : public OpConversionPattern { } }; -struct CmpF64OpConversion : public OpConversionPattern { +struct CmpF64OpConversion : OpConversionPattern { using Base::Base; LogicalResult matchAndRewrite(arith::CmpFOp srcOp, OpAdaptor adaptor, @@ -391,7 +391,7 @@ struct CmpF64OpConversion : public OpConversionPattern { }; template -struct UnaryArithmeticOpConversion : public OpConversionPattern { +struct UnaryArithmeticOpConversion : OpConversionPattern { using OpConversionPattern::OpConversionPattern; LogicalResult matchAndRewrite(SrcOpTy srcOp, typename SrcOpTy::Adaptor adaptor, @@ -413,7 +413,7 @@ struct UnaryArithmeticOpConversion : public OpConversionPattern { }; template -struct BinaryArithmeticOpConversion : public OpConversionPattern { +struct BinaryArithmeticOpConversion : OpConversionPattern { using OpConversionPattern::OpConversionPattern; LogicalResult matchAndRewrite(SrcOpTy srcOp, typename SrcOpTy::Adaptor adaptor, @@ -437,7 +437,7 @@ struct BinaryArithmeticOpConversion : public OpConversionPattern { }; template -struct ShiftArithmeticOpConversion : public OpConversionPattern { +struct ShiftArithmeticOpConversion : OpConversionPattern { using OpConversionPattern::OpConversionPattern; LogicalResult matchAndRewrite(SrcOpTy srcOp, typename SrcOpTy::Adaptor adaptor, @@ -465,7 +465,7 @@ struct ShiftArithmeticOpConversion : public OpConversionPattern { }; template -struct IndexCastOpConversion : public OpConversionPattern { +struct IndexCastOpConversion : OpConversionPattern { using OpConversionPattern::OpConversionPattern; LogicalResult matchAndRewrite(OpTy srcOp, typename OpTy::Adaptor adaptor, @@ -487,7 +487,7 @@ struct IndexCastOpConversion : public OpConversionPattern { } }; -struct ZeroExtendIOpConversion : public OpConversionPattern { +struct ZeroExtendIOpConversion : OpConversionPattern { using Base::Base; LogicalResult matchAndRewrite(arith::ExtUIOp srcOp, OpAdaptor adaptor, @@ -535,7 +535,7 @@ struct ZeroExtendIOpConversion : public OpConversionPattern { } }; -struct SignExtendIOpConversion : public OpConversionPattern { +struct SignExtendIOpConversion : OpConversionPattern { using Base::Base; LogicalResult matchAndRewrite(arith::ExtSIOp srcOp, OpAdaptor adaptor, @@ -604,7 +604,7 @@ struct SignExtendIOpConversion : public OpConversionPattern { } }; -struct TruncateIOpConversion : public OpConversionPattern { +struct TruncateIOpConversion : OpConversionPattern { using Base::Base; LogicalResult matchAndRewrite(arith::TruncIOp srcOp, OpAdaptor adaptor, @@ -651,7 +651,7 @@ struct TruncateIOpConversion : public OpConversionPattern { } }; -struct ExtendFOpConversion : public OpConversionPattern { +struct ExtendFOpConversion : OpConversionPattern { using Base::Base; LogicalResult matchAndRewrite(arith::ExtFOp srcOp, OpAdaptor adaptor, @@ -673,7 +673,7 @@ struct ExtendFOpConversion : public OpConversionPattern { } }; -struct SIToFPOpConversion : public OpConversionPattern { +struct SIToFPOpConversion : OpConversionPattern { using Base::Base; LogicalResult matchAndRewrite(arith::SIToFPOp srcOp, OpAdaptor adaptor, @@ -720,7 +720,7 @@ struct SIToFPOpConversion : public OpConversionPattern { } }; -struct UIToFPOpConversion : public OpConversionPattern { +struct UIToFPOpConversion : OpConversionPattern { using Base::Base; LogicalResult matchAndRewrite(arith::UIToFPOp srcOp, OpAdaptor adaptor, @@ -768,7 +768,7 @@ struct UIToFPOpConversion : public OpConversionPattern { } }; -struct FPToSIOpConversion : public OpConversionPattern { +struct FPToSIOpConversion : OpConversionPattern { using Base::Base; LogicalResult matchAndRewrite(arith::FPToSIOp srcOp, OpAdaptor adaptor, @@ -794,7 +794,7 @@ struct FPToSIOpConversion : public OpConversionPattern { } }; -struct FPToUIOpConversion : public OpConversionPattern { +struct FPToUIOpConversion : OpConversionPattern { using Base::Base; LogicalResult matchAndRewrite(arith::FPToUIOp srcOp, OpAdaptor adaptor, @@ -818,7 +818,7 @@ struct FPToUIOpConversion : public OpConversionPattern { } }; -struct BitcastOpConversion : public OpConversionPattern { +struct BitcastOpConversion : OpConversionPattern { using Base::Base; LogicalResult matchAndRewrite(arith::BitcastOp srcOp, OpAdaptor adaptor, @@ -854,7 +854,7 @@ struct BitcastOpConversion : public OpConversionPattern { } }; -struct SelectOpConversion : public OpConversionPattern { +struct SelectOpConversion : OpConversionPattern { using Base::Base; LogicalResult matchAndRewrite(arith::SelectOp srcOp, OpAdaptor adaptor, diff --git a/compiler/src/iree/compiler/Dialect/VM/Conversion/StandardToVM/Patterns.cpp b/compiler/src/iree/compiler/Dialect/VM/Conversion/StandardToVM/Patterns.cpp index e651bc9b995b..45fd362935d0 100644 --- a/compiler/src/iree/compiler/Dialect/VM/Conversion/StandardToVM/Patterns.cpp +++ b/compiler/src/iree/compiler/Dialect/VM/Conversion/StandardToVM/Patterns.cpp @@ -25,7 +25,7 @@ namespace mlir::iree_compiler { namespace { -struct ModuleOpConversion : public OpConversionPattern { +struct ModuleOpConversion : OpConversionPattern { using Base::Base; LogicalResult matchAndRewrite(ModuleOp srcOp, OpAdaptor adaptor, @@ -109,7 +109,7 @@ static void copyFuncAttrs(func::FuncOp srcOp, Operation *dstOp) { } } -struct FuncOpConversion : public OpConversionPattern { +struct FuncOpConversion : OpConversionPattern { using Base::Base; LogicalResult matchAndRewrite(func::FuncOp srcOp, OpAdaptor adaptor, @@ -185,7 +185,7 @@ static void copyImportAttrs(func::FuncOp srcOp, IREE::VM::ImportOp dstOp) { } } -struct ExternalFuncOpConversion : public OpConversionPattern { +struct ExternalFuncOpConversion : OpConversionPattern { using Base::Base; LogicalResult matchAndRewrite(func::FuncOp srcOp, OpAdaptor adaptor, @@ -243,7 +243,7 @@ struct ExternalFuncOpConversion : public OpConversionPattern { } }; -struct CallOpConversion : public OpConversionPattern { +struct CallOpConversion : OpConversionPattern { ImportTable &importTable; CallOpConversion(const TypeConverter &typeConverter, MLIRContext *context, ImportTable &importTable, PatternBenefit benefit = 1) @@ -396,7 +396,7 @@ struct CallOpConversion : public OpConversionPattern { } }; -struct ReturnOpConversion : public OpConversionPattern { +struct ReturnOpConversion : OpConversionPattern { using Base::Base; LogicalResult matchAndRewrite(mlir::func::ReturnOp srcOp, OpAdaptor adaptor, @@ -408,7 +408,7 @@ struct ReturnOpConversion : public OpConversionPattern { }; template -struct CastingOpConversion final : public OpConversionPattern { +struct CastingOpConversion final : OpConversionPattern { using OpConversionPattern::OpConversionPattern; LogicalResult matchAndRewrite(StdOp srcOp, typename StdOp::Adaptor adaptor, @@ -418,7 +418,7 @@ struct CastingOpConversion final : public OpConversionPattern { } }; -struct AssertOpConversion : public OpConversionPattern { +struct AssertOpConversion : OpConversionPattern { using Base::Base; LogicalResult matchAndRewrite(cf::AssertOp srcOp, OpAdaptor adaptor, @@ -438,7 +438,7 @@ struct AssertOpConversion : public OpConversionPattern { } }; -struct BranchOpConversion : public OpConversionPattern { +struct BranchOpConversion : OpConversionPattern { using Base::Base; LogicalResult matchAndRewrite(cf::BranchOp srcOp, OpAdaptor adaptor, @@ -449,7 +449,7 @@ struct BranchOpConversion : public OpConversionPattern { } }; -struct CondBranchOpConversion : public OpConversionPattern { +struct CondBranchOpConversion : OpConversionPattern { using Base::Base; LogicalResult matchAndRewrite(cf::CondBranchOp srcOp, OpAdaptor adaptor, @@ -462,7 +462,7 @@ struct CondBranchOpConversion : public OpConversionPattern { } }; -struct SwitchOpConversion : public OpConversionPattern { +struct SwitchOpConversion : OpConversionPattern { using Base::Base; LogicalResult matchAndRewrite(cf::SwitchOp srcOp, OpAdaptor adaptor, diff --git a/compiler/src/iree/compiler/Dialect/VM/Conversion/UtilToVM/ConvertAlignmentOps.cpp b/compiler/src/iree/compiler/Dialect/VM/Conversion/UtilToVM/ConvertAlignmentOps.cpp index 339e80d8c2b9..95db10280ab2 100644 --- a/compiler/src/iree/compiler/Dialect/VM/Conversion/UtilToVM/ConvertAlignmentOps.cpp +++ b/compiler/src/iree/compiler/Dialect/VM/Conversion/UtilToVM/ConvertAlignmentOps.cpp @@ -47,7 +47,7 @@ void insertAlignOps(IREE::Util::AlignOp srcOp, rewriter.replaceOp(srcOp, andValue); } -struct AlignOpConversion : public OpConversionPattern { +struct AlignOpConversion : OpConversionPattern { using Base::Base; LogicalResult matchAndRewrite(IREE::Util::AlignOp srcOp, OpAdaptor adaptor, @@ -79,8 +79,7 @@ struct AlignOpConversion : public OpConversionPattern { /// concrete type for index and rewrites to that. This allows us to do late /// resolution of the size of the index type at the point of conversion to VM /// where it is known. -struct FixateIndexSizeofConversion - : public OpConversionPattern { +struct FixateIndexSizeofConversion : OpConversionPattern { using Base::Base; LogicalResult matchAndRewrite(IREE::Util::SizeOfOp sizeofOp, OpAdaptor adaptor, diff --git a/compiler/src/iree/compiler/Dialect/VM/Conversion/UtilToVM/ConvertAssignmentOps.cpp b/compiler/src/iree/compiler/Dialect/VM/Conversion/UtilToVM/ConvertAssignmentOps.cpp index 96e42eeda0c4..8304323f24d0 100644 --- a/compiler/src/iree/compiler/Dialect/VM/Conversion/UtilToVM/ConvertAssignmentOps.cpp +++ b/compiler/src/iree/compiler/Dialect/VM/Conversion/UtilToVM/ConvertAssignmentOps.cpp @@ -22,7 +22,7 @@ namespace { // util.switch //===----------------------------------------------------------------------===// -struct SwitchOpConversion : public OpConversionPattern { +struct SwitchOpConversion : OpConversionPattern { using Base::Base; LogicalResult matchAndRewrite(IREE::Util::SwitchOp op, OpAdaptor adaptor, diff --git a/compiler/src/iree/compiler/Dialect/VM/Conversion/UtilToVM/ConvertBufferOps.cpp b/compiler/src/iree/compiler/Dialect/VM/Conversion/UtilToVM/ConvertBufferOps.cpp index d78f6e781d7d..cd680894e7e4 100644 --- a/compiler/src/iree/compiler/Dialect/VM/Conversion/UtilToVM/ConvertBufferOps.cpp +++ b/compiler/src/iree/compiler/Dialect/VM/Conversion/UtilToVM/ConvertBufferOps.cpp @@ -36,7 +36,7 @@ static Value castToIndex(Value value, OpBuilder &builder) { } struct BufferConstantOpConversion - : public OpConversionPattern { + : OpConversionPattern { using Base::Base; LogicalResult matchAndRewrite(IREE::Util::BufferConstantOp op, OpAdaptor adaptor, @@ -64,7 +64,7 @@ static Value getAlignment(Location loc, std::optional alignment, } struct BufferAllocOpConversion - : public OpConversionPattern { + : OpConversionPattern { using Base::Base; LogicalResult matchAndRewrite(IREE::Util::BufferAllocOp allocOp, OpAdaptor adaptor, @@ -79,7 +79,7 @@ struct BufferAllocOpConversion }; struct BufferDeallocOpConversion - : public OpConversionPattern { + : OpConversionPattern { using Base::Base; LogicalResult matchAndRewrite(IREE::Util::BufferDeallocOp deallocOp, OpAdaptor adaptor, @@ -95,7 +95,7 @@ struct BufferDeallocOpConversion // We could have a vm.buffer.slice op if we wanted; today there's nothing we'd // do in the runtime besides this. struct BufferSliceOpConversion - : public OpConversionPattern { + : OpConversionPattern { using Base::Base; LogicalResult matchAndRewrite(IREE::Util::BufferSliceOp sliceOp, OpAdaptor adaptor, @@ -116,8 +116,7 @@ struct BufferSliceOpConversion } }; -struct BufferSizeOpConversion - : public OpConversionPattern { +struct BufferSizeOpConversion : OpConversionPattern { using Base::Base; LogicalResult matchAndRewrite(IREE::Util::BufferSizeOp sizeOp, OpAdaptor adaptor, @@ -129,8 +128,7 @@ struct BufferSizeOpConversion } }; -struct BufferCopyOpConversion - : public OpConversionPattern { +struct BufferCopyOpConversion : OpConversionPattern { using Base::Base; LogicalResult matchAndRewrite(IREE::Util::BufferCopyOp copyOp, OpAdaptor adaptor, @@ -145,7 +143,7 @@ struct BufferCopyOpConversion }; struct BufferCompareOpConversion - : public OpConversionPattern { + : OpConversionPattern { using Base::Base; LogicalResult matchAndRewrite(IREE::Util::BufferCompareOp compareOp, OpAdaptor adaptor, @@ -171,8 +169,7 @@ static Value unscaleOffset(Location loc, Value offset, int64_t scale, IREE::VM::ConstI64Op::create(builder, loc, scale)); } -struct BufferFillOpConversion - : public OpConversionPattern { +struct BufferFillOpConversion : OpConversionPattern { using Base::Base; LogicalResult matchAndRewrite(IREE::Util::BufferFillOp fillOp, OpAdaptor adaptor, @@ -235,8 +232,7 @@ struct BufferFillOpConversion } }; -struct BufferLoadOpConversion - : public OpConversionPattern { +struct BufferLoadOpConversion : OpConversionPattern { using Base::Base; LogicalResult matchAndRewrite(IREE::Util::BufferLoadOp loadOp, OpAdaptor adaptor, @@ -303,7 +299,7 @@ struct BufferLoadOpConversion }; struct BufferStoreOpConversion - : public OpConversionPattern { + : OpConversionPattern { using Base::Base; LogicalResult matchAndRewrite(IREE::Util::BufferStoreOp storeOp, OpAdaptor adaptor, @@ -357,8 +353,7 @@ struct BufferStoreOpConversion } }; -struct BufferHashOpConversion - : public OpConversionPattern { +struct BufferHashOpConversion : OpConversionPattern { using Base::Base; LogicalResult matchAndRewrite(IREE::Util::BufferHashOp hashOp, OpAdaptor adaptor, diff --git a/compiler/src/iree/compiler/Dialect/VM/Conversion/UtilToVM/ConvertGlobalOps.cpp b/compiler/src/iree/compiler/Dialect/VM/Conversion/UtilToVM/ConvertGlobalOps.cpp index 8940ff145638..deca54754c7c 100644 --- a/compiler/src/iree/compiler/Dialect/VM/Conversion/UtilToVM/ConvertGlobalOps.cpp +++ b/compiler/src/iree/compiler/Dialect/VM/Conversion/UtilToVM/ConvertGlobalOps.cpp @@ -14,7 +14,7 @@ namespace mlir::iree_compiler { namespace { -struct GlobalOpConversion : public OpConversionPattern { +struct GlobalOpConversion : OpConversionPattern { TypeConverter &typeConverter; GlobalOpConversion(MLIRContext *context, TypeConverter &typeConverter) : OpConversionPattern(context), typeConverter(typeConverter) {} @@ -79,7 +79,7 @@ struct GlobalOpConversion : public OpConversionPattern { }; struct GlobalAddressOpConversion - : public OpConversionPattern { + : OpConversionPattern { TypeConverter &typeConverter; GlobalAddressOpConversion(MLIRContext *context, TypeConverter &typeConverter) : OpConversionPattern(context), typeConverter(typeConverter) {} @@ -93,8 +93,7 @@ struct GlobalAddressOpConversion } }; -struct GlobalLoadOpConversion - : public OpConversionPattern { +struct GlobalLoadOpConversion : OpConversionPattern { TypeConverter &typeConverter; GlobalLoadOpConversion(MLIRContext *context, TypeConverter &typeConverter) : OpConversionPattern(context), typeConverter(typeConverter) {} @@ -126,7 +125,7 @@ struct GlobalLoadOpConversion }; struct GlobalLoadIndirectOpConversion - : public OpConversionPattern { + : OpConversionPattern { TypeConverter &typeConverter; GlobalLoadIndirectOpConversion(MLIRContext *context, TypeConverter &typeConverter) @@ -159,7 +158,7 @@ struct GlobalLoadIndirectOpConversion }; struct GlobalStoreOpConversion - : public OpConversionPattern { + : OpConversionPattern { GlobalStoreOpConversion(MLIRContext *context, TypeConverter &typeConverter) : OpConversionPattern(context) {} LogicalResult @@ -189,7 +188,7 @@ struct GlobalStoreOpConversion }; struct GlobalStoreIndirectOpConversion - : public OpConversionPattern { + : OpConversionPattern { GlobalStoreIndirectOpConversion(MLIRContext *context, TypeConverter &typeConverter) : OpConversionPattern(context) {} diff --git a/compiler/src/iree/compiler/Dialect/VM/Conversion/UtilToVM/ConvertStringOps.cpp b/compiler/src/iree/compiler/Dialect/VM/Conversion/UtilToVM/ConvertStringOps.cpp index cf2e0b57de25..2e881ab1175b 100644 --- a/compiler/src/iree/compiler/Dialect/VM/Conversion/UtilToVM/ConvertStringOps.cpp +++ b/compiler/src/iree/compiler/Dialect/VM/Conversion/UtilToVM/ConvertStringOps.cpp @@ -140,8 +140,7 @@ static void registerStringBuiltins(BuiltinRegistry &builtins, builtins.add(kItoaBuiltinName, itoaType, buildItoaBody); } -struct StringItoaOpConversion - : public OpConversionPattern { +struct StringItoaOpConversion : OpConversionPattern { BuiltinRegistry &builtins; StringItoaOpConversion(const TypeConverter &typeConverter, MLIRContext *context, BuiltinRegistry &builtins) @@ -158,7 +157,7 @@ struct StringItoaOpConversion }; struct StringFormatOpConversion - : public OpConversionPattern { + : OpConversionPattern { BuiltinRegistry &builtins; StringFormatOpConversion(const TypeConverter &typeConverter, MLIRContext *context, BuiltinRegistry &builtins) diff --git a/compiler/src/iree/compiler/Dialect/VM/Conversion/UtilToVM/ConvertStructuralOps.cpp b/compiler/src/iree/compiler/Dialect/VM/Conversion/UtilToVM/ConvertStructuralOps.cpp index 65f723cf6513..d9812e0fcaa4 100644 --- a/compiler/src/iree/compiler/Dialect/VM/Conversion/UtilToVM/ConvertStructuralOps.cpp +++ b/compiler/src/iree/compiler/Dialect/VM/Conversion/UtilToVM/ConvertStructuralOps.cpp @@ -16,7 +16,7 @@ namespace mlir::iree_compiler { namespace { struct InitializerOpConversion - : public OpConversionPattern { + : OpConversionPattern { using Base::Base; LogicalResult matchAndRewrite(IREE::Util::InitializerOp op, OpAdaptor adaptor, @@ -219,7 +219,7 @@ class ExternalFuncOpConversion } }; -struct CallOpConversion : public OpConversionPattern { +struct CallOpConversion : OpConversionPattern { ImportTable &importTable; CallOpConversion(const TypeConverter &typeConverter, MLIRContext *context, ImportTable &importTable, PatternBenefit benefit = 1) @@ -370,7 +370,7 @@ struct CallOpConversion : public OpConversionPattern { } }; -struct ReturnOpConversion : public OpConversionPattern { +struct ReturnOpConversion : OpConversionPattern { using Base::Base; LogicalResult matchAndRewrite(IREE::Util::ReturnOp op, OpAdaptor adaptor, @@ -381,7 +381,7 @@ struct ReturnOpConversion : public OpConversionPattern { }; struct UnreachableOpConversion - : public OpConversionPattern { + : OpConversionPattern { using OpConversionPattern::OpConversionPattern; LogicalResult matchAndRewrite(IREE::Util::UnreachableOp op, OpAdaptor adaptor, diff --git a/compiler/src/iree/compiler/Dialect/VM/Conversion/UtilToVM/Patterns.cpp b/compiler/src/iree/compiler/Dialect/VM/Conversion/UtilToVM/Patterns.cpp index 9711a4140bc7..e85f810e1d8a 100644 --- a/compiler/src/iree/compiler/Dialect/VM/Conversion/UtilToVM/Patterns.cpp +++ b/compiler/src/iree/compiler/Dialect/VM/Conversion/UtilToVM/Patterns.cpp @@ -60,7 +60,7 @@ namespace { // util.null //===----------------------------------------------------------------------===// -struct NullOpConversion : public OpConversionPattern { +struct NullOpConversion : OpConversionPattern { using Base::Base; LogicalResult matchAndRewrite(IREE::Util::NullOp op, OpAdaptor adaptor, @@ -75,7 +75,7 @@ struct NullOpConversion : public OpConversionPattern { // util.cmp.eq //===----------------------------------------------------------------------===// -struct CmpEQOpConversion : public OpConversionPattern { +struct CmpEQOpConversion : OpConversionPattern { using Base::Base; LogicalResult matchAndRewrite(IREE::Util::CmpEQOp op, OpAdaptor adaptor, @@ -94,7 +94,7 @@ struct CmpEQOpConversion : public OpConversionPattern { // util.cmp.ne //===----------------------------------------------------------------------===// -struct CmpNEOpConversion : public OpConversionPattern { +struct CmpNEOpConversion : OpConversionPattern { using Base::Base; LogicalResult matchAndRewrite(IREE::Util::CmpNEOp op, OpAdaptor adaptor, @@ -114,7 +114,7 @@ struct CmpNEOpConversion : public OpConversionPattern { //===----------------------------------------------------------------------===// struct OptimizationBarrierOpConversion - : public OpConversionPattern { + : OpConversionPattern { using OpConversionPattern::OpConversionPattern; LogicalResult matchAndRewrite(IREE::Util::OptimizationBarrierOp op, OpAdaptor adaptor, diff --git a/compiler/src/iree/compiler/Dialect/VM/IR/VMDialect.cpp b/compiler/src/iree/compiler/Dialect/VM/IR/VMDialect.cpp index f0c34d7c2998..d891e1de0ef2 100644 --- a/compiler/src/iree/compiler/Dialect/VM/IR/VMDialect.cpp +++ b/compiler/src/iree/compiler/Dialect/VM/IR/VMDialect.cpp @@ -65,7 +65,7 @@ struct VMDialect::VMOpAsmInterface namespace { // Used to control inlining behavior. -struct VMInlinerInterface : public DialectInlinerInterface { +struct VMInlinerInterface : DialectInlinerInterface { using DialectInlinerInterface::DialectInlinerInterface; bool isLegalToInline(Operation *call, Operation *callable, @@ -128,7 +128,7 @@ struct VMInlinerInterface : public DialectInlinerInterface { } }; -struct VMFolderInterface : public DialectFoldInterface { +struct VMFolderInterface : DialectFoldInterface { using DialectFoldInterface::DialectFoldInterface; bool shouldMaterializeInto(Region *region) const override { diff --git a/compiler/src/iree/compiler/Dialect/VM/IR/VMOpFolders.cpp b/compiler/src/iree/compiler/Dialect/VM/IR/VMOpFolders.cpp index 7fec93fecff7..d0b8226df66f 100644 --- a/compiler/src/iree/compiler/Dialect/VM/IR/VMOpFolders.cpp +++ b/compiler/src/iree/compiler/Dialect/VM/IR/VMOpFolders.cpp @@ -61,7 +61,7 @@ Attribute oneOfType(Type type) { namespace { // Deletes empty vm.initializer ops. -struct DropEmptyInitializerOp : public OpRewritePattern { +struct DropEmptyInitializerOp : OpRewritePattern { using Base::Base; LogicalResult matchAndRewrite(InitializerOp op, PatternRewriter &rewriter) const override { @@ -80,7 +80,7 @@ struct DropEmptyInitializerOp : public OpRewritePattern { // Inlines constant stores from initializers into the global initializer. // This is not strictly required but can help our initialization code perform // more efficient initialization of large numbers of primitive values. -struct InlineConstGlobalInitializer : public OpRewritePattern { +struct InlineConstGlobalInitializer : OpRewritePattern { using Base::Base; LogicalResult matchAndRewrite(InitializerOp op, @@ -137,7 +137,7 @@ namespace { /// Drops initial_values from globals where the value is 0, as by default all /// globals are zero-initialized upon module load. template -struct DropDefaultConstGlobalOpInitializer : public OpRewritePattern { +struct DropDefaultConstGlobalOpInitializer : OpRewritePattern { using OpRewritePattern::OpRewritePattern; LogicalResult matchAndRewrite(T op, PatternRewriter &rewriter) const override { @@ -202,7 +202,7 @@ void GlobalLoadF64Op::getCanonicalizationPatterns(RewritePatternSet &results, namespace { template -struct PropagateGlobalLoadAddress : public OpRewritePattern { +struct PropagateGlobalLoadAddress : OpRewritePattern { using OpRewritePattern::OpRewritePattern; LogicalResult matchAndRewrite(INDIRECT op, PatternRewriter &rewriter) const override { @@ -258,7 +258,7 @@ void GlobalLoadIndirectRefOp::getCanonicalizationPatterns( namespace { template -struct PropagateGlobalStoreAddress : public OpRewritePattern { +struct PropagateGlobalStoreAddress : OpRewritePattern { using OpRewritePattern::OpRewritePattern; LogicalResult matchAndRewrite(INDIRECT op, PatternRewriter &rewriter) const override { @@ -317,7 +317,7 @@ void GlobalStoreIndirectRefOp::getCanonicalizationPatterns( namespace { template -struct FoldZeroConstPrimitive final : public OpRewritePattern { +struct FoldZeroConstPrimitive final : OpRewritePattern { using OpRewritePattern::OpRewritePattern; LogicalResult matchAndRewrite(GeneralOp constOp, PatternRewriter &rewriter) const override { @@ -647,7 +647,7 @@ static Attribute constFoldTernaryOp(Attribute rawA, Attribute rawB, // -> // %1 = vm.fma.f32 %a, %b, %c : f32 template -struct FuseFMAOp : public OpRewritePattern { +struct FuseFMAOp : OpRewritePattern { using OpRewritePattern::OpRewritePattern; LogicalResult matchAndRewrite(AddOp addOp, PatternRewriter &rewriter) const override { @@ -781,7 +781,7 @@ static OpFoldResult foldMulOp(T op, Attribute lhs, Attribute rhs) { template -struct FoldConstantMulOperand : public OpRewritePattern { +struct FoldConstantMulOperand : OpRewritePattern { using OpRewritePattern::OpRewritePattern; LogicalResult matchAndRewrite(T op, PatternRewriter &rewriter) const override { @@ -949,7 +949,7 @@ static OpFoldResult foldFMAOp(T op, Attribute a, Attribute b, Attribute c) { } template -struct CanonicalizeFMA final : public OpRewritePattern { +struct CanonicalizeFMA final : OpRewritePattern { using OpRewritePattern::OpRewritePattern; LogicalResult matchAndRewrite(FMAOp fmaOp, PatternRewriter &rewriter) const override { @@ -1634,8 +1634,7 @@ OpFoldResult ExtF32F64Op::fold(FoldAdaptor operands) { namespace { template -struct PseudoIntegerConversionToSplitConversionOp - : public OpRewritePattern { +struct PseudoIntegerConversionToSplitConversionOp : OpRewritePattern { using OpRewritePattern::OpRewritePattern; LogicalResult matchAndRewrite(SRC_OP op, PatternRewriter &rewriter) const override { @@ -1837,7 +1836,7 @@ namespace { /// Folds cast ops into the result of other ops. /// Only safe to apply to ops that don't care about their types. template -struct FoldCastRefIntoOpResult : public OpRewritePattern { +struct FoldCastRefIntoOpResult : OpRewritePattern { using OpRewritePattern::OpRewritePattern; LogicalResult matchAndRewrite(CastOp castOp, PatternRewriter &rewriter) const override { @@ -1942,7 +1941,7 @@ static Attribute constFoldBinaryCmpOp(Attribute rawLhs, Attribute rawRhs, /// Swaps the cmp op with its inverse if the result is inverted. template -struct SwapInvertedCmpOps : public OpRewritePattern { +struct SwapInvertedCmpOps : OpRewritePattern { using OpRewritePattern::OpRewritePattern; LogicalResult matchAndRewrite(OP op, PatternRewriter &rewriter) const override { @@ -2021,7 +2020,7 @@ namespace { /// Changes a cmp.ne.i32 check against 0 to a cmp.nz.i32. template -struct CmpNEZeroToCmpNZ : public OpRewritePattern { +struct CmpNEZeroToCmpNZ : OpRewritePattern { using OpRewritePattern::OpRewritePattern; LogicalResult matchAndRewrite(NE_OP op, PatternRewriter &rewriter) const override { @@ -2099,7 +2098,7 @@ namespace { /// Rewrites a vm.cmp.lte.* pseudo op to a vm.cmp.lt.* op. template -struct RewritePseudoCmpLTEToLT : public OpRewritePattern { +struct RewritePseudoCmpLTEToLT : OpRewritePattern { using OpRewritePattern::OpRewritePattern; LogicalResult matchAndRewrite(T op, PatternRewriter &rewriter) const override { @@ -2179,7 +2178,7 @@ namespace { /// Rewrites a vm.cmp.gt.* pseudo op to a vm.cmp.lt.* op. template -struct RewritePseudoCmpGTToLT : public OpRewritePattern { +struct RewritePseudoCmpGTToLT : OpRewritePattern { using OpRewritePattern::OpRewritePattern; LogicalResult matchAndRewrite(T op, PatternRewriter &rewriter) const override { @@ -2255,7 +2254,7 @@ namespace { /// Rewrites a vm.cmp.gte.* pseudo op to a vm.cmp.lt.* op. template -struct RewritePseudoCmpGTEToLT : public OpRewritePattern { +struct RewritePseudoCmpGTEToLT : OpRewritePattern { using OpRewritePattern::OpRewritePattern; LogicalResult matchAndRewrite(T op, PatternRewriter &rewriter) const override { @@ -2471,7 +2470,7 @@ static constexpr int64_t kMaxUlpsDiffF64 = 50000000000ll; template -struct RewritePseudoCmpNear : public OpRewritePattern { +struct RewritePseudoCmpNear : OpRewritePattern { using OpRewritePattern::OpRewritePattern; LogicalResult matchAndRewrite(T op, PatternRewriter &rewriter) const override { @@ -2837,7 +2836,7 @@ namespace { /// Rewrites a vm.cmp.nz.* pseudo op to a vm.cmp.ne.* op with a constant 0. template -struct RewritePseudoCmpNZToNE : public OpRewritePattern { +struct RewritePseudoCmpNZToNE : OpRewritePattern { using OpRewritePattern::OpRewritePattern; LogicalResult matchAndRewrite(T op, PatternRewriter &rewriter) const override { @@ -2936,7 +2935,7 @@ OpFoldResult CmpEQRefOp::fold(FoldAdaptor operands) { namespace { /// Changes a cmp.eq.ref check against null to a cmp.nz.ref and inverted cond. -struct NullCheckCmpEQRefToCmpNZRef : public OpRewritePattern { +struct NullCheckCmpEQRefToCmpNZRef : OpRewritePattern { using Base::Base; LogicalResult matchAndRewrite(CmpEQRefOp op, PatternRewriter &rewriter) const override { @@ -2971,7 +2970,7 @@ OpFoldResult CmpNERefOp::fold(FoldAdaptor operands) { namespace { /// Changes a cmp.ne.ref check against null to a cmp.nz.ref. -struct NullCheckCmpNERefToCmpNZRef : public OpRewritePattern { +struct NullCheckCmpNERefToCmpNZRef : OpRewritePattern { using Base::Base; LogicalResult matchAndRewrite(CmpNERefOp op, PatternRewriter &rewriter) const override { @@ -3072,7 +3071,7 @@ namespace { /// merges the two blocks. /// /// (same logic as for std.br) -struct SimplifyBrToBlockWithSinglePred : public OpRewritePattern { +struct SimplifyBrToBlockWithSinglePred : OpRewritePattern { using Base::Base; LogicalResult matchAndRewrite(BranchOp op, PatternRewriter &rewriter) const override { @@ -3098,7 +3097,7 @@ struct SimplifyBrToBlockWithSinglePred : public OpRewritePattern { /// -> br ^bbN(...) /// /// (same logic as for std.br) -struct SimplifyPassThroughBr : public OpRewritePattern { +struct SimplifyPassThroughBr : OpRewritePattern { using Base::Base; LogicalResult matchAndRewrite(BranchOp op, PatternRewriter &rewriter) const override { @@ -3130,7 +3129,7 @@ void BranchOp::getCanonicalizationPatterns(RewritePatternSet &results, namespace { /// Simplifies a cond_br with a constant condition to an unconditional branch. -struct SimplifyConstCondBranchPred : public OpRewritePattern { +struct SimplifyConstCondBranchPred : OpRewritePattern { using Base::Base; LogicalResult matchAndRewrite(CondBranchOp op, PatternRewriter &rewriter) const override { @@ -3151,7 +3150,7 @@ struct SimplifyConstCondBranchPred : public OpRewritePattern { /// Simplifies a cond_br with both targets (including operands) being equal to /// an unconditional branch. -struct SimplifySameTargetCondBranchOp : public OpRewritePattern { +struct SimplifySameTargetCondBranchOp : OpRewritePattern { using Base::Base; LogicalResult matchAndRewrite(CondBranchOp op, PatternRewriter &rewriter) const override { @@ -3174,7 +3173,7 @@ struct SimplifySameTargetCondBranchOp : public OpRewritePattern { }; /// Swaps the cond_br true and false targets if the condition is inverted. -struct SwapInvertedCondBranchOpTargets : public OpRewritePattern { +struct SwapInvertedCondBranchOpTargets : OpRewritePattern { using Base::Base; LogicalResult matchAndRewrite(CondBranchOp op, PatternRewriter &rewriter) const override { @@ -3212,7 +3211,7 @@ void CallOp::getCanonicalizationPatterns(RewritePatternSet &results, namespace { /// Converts a vm.call.variadic to a non-variadic function to a normal vm.call. -struct ConvertNonVariadicToCallOp : public OpRewritePattern { +struct ConvertNonVariadicToCallOp : OpRewritePattern { using Base::Base; LogicalResult matchAndRewrite(CallVariadicOp op, PatternRewriter &rewriter) const override { @@ -3239,7 +3238,7 @@ void CallVariadicOp::getCanonicalizationPatterns(RewritePatternSet &results, namespace { /// Rewrites a cond_fail op to a cond_branch to a fail op. -struct RewriteCondFailToBranchFail : public OpRewritePattern { +struct RewriteCondFailToBranchFail : OpRewritePattern { using Base::Base; LogicalResult matchAndRewrite(CondFailOp op, PatternRewriter &rewriter) const override { @@ -3279,7 +3278,7 @@ namespace { /// Rewrites a check op to a cmp and a cond_fail. template -struct RewriteCheckToCondFail : public OpRewritePattern { +struct RewriteCheckToCondFail : OpRewritePattern { using OpRewritePattern::OpRewritePattern; LogicalResult matchAndRewrite(CheckOp op, PatternRewriter &rewriter) const override { @@ -3354,7 +3353,7 @@ void CheckNearlyEQOp::getCanonicalizationPatterns(RewritePatternSet &results, namespace { // Folds vm.import.resolved ops referencing required imports. -struct RequiredImportResolver : public OpRewritePattern { +struct RequiredImportResolver : OpRewritePattern { using Base::Base; LogicalResult matchAndRewrite(ImportResolvedOp op, PatternRewriter &rewriter) const override { @@ -3386,7 +3385,7 @@ void ImportResolvedOp::getCanonicalizationPatterns(RewritePatternSet &results, namespace { template -struct RemoveDisabledDebugOp : public OpRewritePattern { +struct RemoveDisabledDebugOp : OpRewritePattern { using OpRewritePattern::OpRewritePattern; LogicalResult matchAndRewrite(T op, PatternRewriter &rewriter) const override { @@ -3396,7 +3395,7 @@ struct RemoveDisabledDebugOp : public OpRewritePattern { }; template -struct RemoveDisabledDebugAsyncOp : public OpRewritePattern { +struct RemoveDisabledDebugAsyncOp : OpRewritePattern { using OpRewritePattern::OpRewritePattern; LogicalResult matchAndRewrite(T op, PatternRewriter &rewriter) const override { @@ -3405,7 +3404,7 @@ struct RemoveDisabledDebugAsyncOp : public OpRewritePattern { } }; -struct SimplifyConstCondBreakPred : public OpRewritePattern { +struct SimplifyConstCondBreakPred : OpRewritePattern { using Base::Base; LogicalResult matchAndRewrite(CondBreakOp op, PatternRewriter &rewriter) const override { diff --git a/compiler/src/iree/compiler/Dialect/VM/IR/VMTypes.cpp b/compiler/src/iree/compiler/Dialect/VM/IR/VMTypes.cpp index 02d2b7df847f..214143866a56 100644 --- a/compiler/src/iree/compiler/Dialect/VM/IR/VMTypes.cpp +++ b/compiler/src/iree/compiler/Dialect/VM/IR/VMTypes.cpp @@ -27,7 +27,7 @@ namespace mlir::iree_compiler::IREE::VM { namespace detail { -struct ListTypeStorage : public TypeStorage { +struct ListTypeStorage : TypeStorage { ListTypeStorage(Type elementType) : elementType(elementType) {} /// The hash key used for uniquing. @@ -82,7 +82,7 @@ Type ListType::getElementType() { return getImpl()->elementType; } namespace detail { -struct RefTypeStorage : public TypeStorage { +struct RefTypeStorage : TypeStorage { RefTypeStorage(Type objectType) : objectType(cast(objectType)) {} /// The hash key used for uniquing. diff --git a/compiler/src/iree/compiler/Dialect/VM/Transforms/Conversion.cpp b/compiler/src/iree/compiler/Dialect/VM/Transforms/Conversion.cpp index 4f2c6c19e7e0..b259137c4c29 100644 --- a/compiler/src/iree/compiler/Dialect/VM/Transforms/Conversion.cpp +++ b/compiler/src/iree/compiler/Dialect/VM/Transforms/Conversion.cpp @@ -43,8 +43,7 @@ namespace { /// Drops util.assume.int ops during VM conversion. /// These hints have no VM-level meaning and would otherwise fail legalization /// when their types need conversion (e.g., index -> i32). -struct DropAssumeIntPattern - : public OpConversionPattern { +struct DropAssumeIntPattern : OpConversionPattern { using OpConversionPattern::OpConversionPattern; LogicalResult matchAndRewrite(IREE::Util::AssumeIntOp op, OpAdaptor adaptor, diff --git a/compiler/src/iree/compiler/Dialect/VM/Transforms/DropUnusedCalls.cpp b/compiler/src/iree/compiler/Dialect/VM/Transforms/DropUnusedCalls.cpp index ed66c8e2aa06..51707e21563d 100644 --- a/compiler/src/iree/compiler/Dialect/VM/Transforms/DropUnusedCalls.cpp +++ b/compiler/src/iree/compiler/Dialect/VM/Transforms/DropUnusedCalls.cpp @@ -24,7 +24,7 @@ namespace { /// Removes vm.call ops to functions that are marked as having no side-effects /// if the results are unused. template -struct EraseUnusedCallOp : public OpRewritePattern { +struct EraseUnusedCallOp : OpRewritePattern { DenseSet &noSideEffectsSymbols; EraseUnusedCallOp(MLIRContext *context, DenseSet &noSideEffectsSymbols, diff --git a/compiler/src/iree/compiler/Dialect/VMVX/Conversion/HALToVMVX/ConvertHALToVMVX.cpp b/compiler/src/iree/compiler/Dialect/VMVX/Conversion/HALToVMVX/ConvertHALToVMVX.cpp index 14ad980a1999..4ab941612853 100644 --- a/compiler/src/iree/compiler/Dialect/VMVX/Conversion/HALToVMVX/ConvertHALToVMVX.cpp +++ b/compiler/src/iree/compiler/Dialect/VMVX/Conversion/HALToVMVX/ConvertHALToVMVX.cpp @@ -103,7 +103,7 @@ namespace { /// Rewrites hal.interface.workgroup.id to use the arguments injected onto the /// function. struct ConvertHALInterfaceWorkgroupIDOp - : public OpConversionPattern { + : OpConversionPattern { using Base::Base; LogicalResult matchAndRewrite(IREE::HAL::InterfaceWorkgroupIDOp op, OpAdaptor adaptor, @@ -127,7 +127,7 @@ struct ConvertHALInterfaceWorkgroupIDOp /// Rewrites hal.interface.workgroup.size to use the arguments injected onto the /// function. struct ConvertHALInterfaceWorkgroupSizeOp - : public OpConversionPattern { + : OpConversionPattern { using Base::Base; LogicalResult matchAndRewrite(IREE::HAL::InterfaceWorkgroupSizeOp op, OpAdaptor adaptor, @@ -151,7 +151,7 @@ struct ConvertHALInterfaceWorkgroupSizeOp /// Rewrites hal.interface.workgroup.count to use the arguments injected onto /// the function. struct ConvertHALInterfaceWorkgroupCountOp - : public OpConversionPattern { + : OpConversionPattern { using Base::Base; LogicalResult matchAndRewrite(IREE::HAL::InterfaceWorkgroupCountOp op, OpAdaptor adaptor, @@ -174,7 +174,7 @@ struct ConvertHALInterfaceWorkgroupCountOp /// Rewrites hal.interface.constant.load to ops loading from the ABI structs. struct ConvertHALInterfaceConstantLoadOp - : public OpConversionPattern { + : OpConversionPattern { using Base::Base; LogicalResult matchAndRewrite(IREE::HAL::InterfaceConstantLoadOp op, OpAdaptor adaptor, @@ -204,7 +204,7 @@ struct ConvertHALInterfaceConstantLoadOp }; struct ConvertGetRawInterfaceBindingBufferOp - : public OpConversionPattern { + : OpConversionPattern { using Base::Base; LogicalResult matchAndRewrite(IREE::VMVX::GetRawInterfaceBindingBufferOp op, @@ -232,7 +232,7 @@ struct ConvertGetRawInterfaceBindingBufferOp /// Rewrites hal.interface.binding.subspan to ops loading from the ABI structs. struct ConvertHALInterfaceBindingSubspanOp - : public OpConversionPattern { + : OpConversionPattern { using Base::Base; LogicalResult matchAndRewrite(IREE::HAL::InterfaceBindingSubspanOp op, OpAdaptor adaptor, diff --git a/compiler/src/iree/compiler/Dialect/VMVX/Conversion/StandardToVMVX/ConvertStandardToVMVX.cpp b/compiler/src/iree/compiler/Dialect/VMVX/Conversion/StandardToVMVX/ConvertStandardToVMVX.cpp index 189f0af9992d..dc4c36069baf 100644 --- a/compiler/src/iree/compiler/Dialect/VMVX/Conversion/StandardToVMVX/ConvertStandardToVMVX.cpp +++ b/compiler/src/iree/compiler/Dialect/VMVX/Conversion/StandardToVMVX/ConvertStandardToVMVX.cpp @@ -29,7 +29,7 @@ namespace { /// Pattern to lower operations that become a no-ops at this level. template -struct FoldAsNoOp final : public OpConversionPattern { +struct FoldAsNoOp final : OpConversionPattern { using OpConversionPattern::OpConversionPattern; LogicalResult matchAndRewrite(OpTy op, typename OpTy::Adaptor adaptor, @@ -42,7 +42,7 @@ struct FoldAsNoOp final : public OpConversionPattern { /// Removes unrealized_conversion_cast ops introduced during progressive /// lowering when possible. struct RemoveIdentityConversionCast final - : public OpConversionPattern { + : OpConversionPattern { using Base::Base; LogicalResult matchAndRewrite(UnrealizedConversionCastOp op, OpAdaptor adaptor, diff --git a/compiler/src/iree/compiler/Dialect/VMVX/Transforms/ResolveBufferDescriptors.cpp b/compiler/src/iree/compiler/Dialect/VMVX/Transforms/ResolveBufferDescriptors.cpp index ed2d018c5299..308685cc8154 100644 --- a/compiler/src/iree/compiler/Dialect/VMVX/Transforms/ResolveBufferDescriptors.cpp +++ b/compiler/src/iree/compiler/Dialect/VMVX/Transforms/ResolveBufferDescriptors.cpp @@ -225,7 +225,7 @@ replaceOffsetSizesAndStridesWith(RewriterBase &rewriter, namespace { -struct FromMemRefSubView : public OpRewritePattern { +struct FromMemRefSubView : OpRewritePattern { using Base::Base; LogicalResult matchAndRewrite(GetBufferDescriptorOp op, PatternRewriter &rewriter) const override { @@ -292,7 +292,7 @@ struct FromMemRefSubView : public OpRewritePattern { }; struct FromHalInterfaceBindingSubspan - : public OpRewritePattern { + : OpRewritePattern { using Base::Base; LogicalResult matchAndRewrite(GetBufferDescriptorOp op, PatternRewriter &rewriter) const override { @@ -336,8 +336,7 @@ getBaseBufferReplacementForDescriptor(GetBufferDescriptorOp descriptorOp, .getResult(0); } -struct FromMemRefAssumeAlignment - : public OpRewritePattern { +struct FromMemRefAssumeAlignment : OpRewritePattern { using Base::Base; LogicalResult matchAndRewrite(GetBufferDescriptorOp op, PatternRewriter &rewriter) const override { @@ -377,7 +376,7 @@ struct FromMemRefAssumeAlignment // Allocations always return a non-offset memref and are matched by this // pattern. -struct FromAllocation : public OpRewritePattern { +struct FromAllocation : OpRewritePattern { using Base::Base; LogicalResult matchAndRewrite(GetBufferDescriptorOp op, PatternRewriter &rewriter) const override { @@ -412,7 +411,7 @@ struct FromAllocation : public OpRewritePattern { // MemRef globals are always static shaped and reference a non-offset // buffer. -struct FromGlobal : public OpRewritePattern { +struct FromGlobal : OpRewritePattern { using Base::Base; LogicalResult matchAndRewrite(GetBufferDescriptorOp op, PatternRewriter &rewriter) const override {