Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ bitcastWorkgroupsOutputs(RewriterBase &rewriter,

namespace {
struct BitcastUnsupportedElementTypesPass
: public impl::BitcastUnsupportedElementTypesPassBase<
: impl::BitcastUnsupportedElementTypesPassBase<
BitcastUnsupportedElementTypesPass> {
using Base::Base;
void runOnOperation() override;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ namespace mlir::iree_compiler::DispatchCreation {
namespace {

struct BubbleUpExpandShapesPass final
: public impl::BubbleUpExpandShapesPassBase<BubbleUpExpandShapesPass> {
: impl::BubbleUpExpandShapesPassBase<BubbleUpExpandShapesPass> {
using Base::Base;
void runOnOperation() override;
};
Expand Down Expand Up @@ -142,8 +142,7 @@ struct BubbleUpExtract : OpRewritePattern<tensor::ExtractSliceOp> {
/// tensor.extract_slice(%init)) even when the linalg.fill has multiple users.
/// Bubbles up tensor.extract_slice when encountered with linalg.fill and the
/// former can be folded away.
struct SwapExtractSliceOfFill final
: public OpRewritePattern<tensor::ExtractSliceOp> {
struct SwapExtractSliceOfFill final : OpRewritePattern<tensor::ExtractSliceOp> {
using Base::Base;

LogicalResult matchAndRewrite(tensor::ExtractSliceOp extractOp,
Expand All @@ -169,7 +168,7 @@ struct SwapExtractSliceOfFill final
/// are dynamic.
/// TODO: move this upstream with other tensor bubbling patterns.
struct BubbleExpandThroughExtract final
: public OpRewritePattern<tensor::ExpandShapeOp> {
: OpRewritePattern<tensor::ExpandShapeOp> {

using Base::Base;

Expand Down Expand Up @@ -273,7 +272,7 @@ struct BubbleExpandThroughExtract final
};

struct BubbleExpandThroughConcat final
: public OpRewritePattern<tensor::ExpandShapeOp> {
: OpRewritePattern<tensor::ExpandShapeOp> {
using Base::Base;

LogicalResult matchAndRewrite(tensor::ExpandShapeOp expandOp,
Expand Down Expand Up @@ -383,7 +382,7 @@ struct BubbleExpandThroughConcat final
/// Bubble expand_shape through bitcast: expand_shape(bitcast(x)) ->
/// bitcast(expand_shape(x)).
struct BubbleExpandThroughBitCast final
: public OpRewritePattern<tensor::ExpandShapeOp> {
: OpRewritePattern<tensor::ExpandShapeOp> {
using OpRewritePattern<tensor::ExpandShapeOp>::OpRewritePattern;

LogicalResult matchAndRewrite(tensor::ExpandShapeOp expandOp,
Expand Down Expand Up @@ -485,7 +484,7 @@ struct BubbleExpandThroughBitCast final
/// Sink collapse_shape through bitcast: bitcast(collapse_shape(x)) ->
/// collapse_shape(bitcast(x)).
struct SinkCollapseThroughBitCast final
: public OpRewritePattern<IREE::TensorExt::BitCastOp> {
: OpRewritePattern<IREE::TensorExt::BitCastOp> {
using OpRewritePattern<IREE::TensorExt::BitCastOp>::OpRewritePattern;

LogicalResult matchAndRewrite(IREE::TensorExt::BitCastOp bitcastOp,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ namespace mlir::iree_compiler::DispatchCreation {
namespace {

struct CloneProducersIntoDispatchRegionsPass final
: public impl::CloneProducersIntoDispatchRegionsPassBase<
: impl::CloneProducersIntoDispatchRegionsPassBase<
CloneProducersIntoDispatchRegionsPass> {
using Base::Base;
void runOnOperation() override {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ using IREE::LinalgExt::LinalgFusionOpInterface;
namespace {
/// Pass declaration.
struct CollapseDimensionsPass final
: public impl::CollapseDimensionsPassBase<CollapseDimensionsPass> {
: impl::CollapseDimensionsPassBase<CollapseDimensionsPass> {
using Base::Base;
void runOnOperation() override;
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ namespace mlir::iree_compiler::DispatchCreation {

namespace {
struct ConvertDispatchRegionsToWorkgroupsPass
: public impl::ConvertDispatchRegionsToWorkgroupsPassBase<
: impl::ConvertDispatchRegionsToWorkgroupsPassBase<
ConvertDispatchRegionsToWorkgroupsPass> {
using Base::Base;
void runOnOperation() override;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ namespace mlir::iree_compiler::DispatchCreation {

namespace {
struct ConvertEncodingToFlowPass
: public impl::ConvertEncodingToFlowPassBase<ConvertEncodingToFlowPass> {
: impl::ConvertEncodingToFlowPassBase<ConvertEncodingToFlowPass> {
using Base::Base;
void runOnOperation() override;
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ static FailureOr<size_t> convertExtractSliceOps(

namespace {
struct ConvertTensorToFlowPass
: public impl::ConvertTensorToFlowPassBase<ConvertTensorToFlowPass> {
: impl::ConvertTensorToFlowPassBase<ConvertTensorToFlowPass> {
using Base::Base;
void runOnOperation() override;
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ namespace mlir::iree_compiler::DispatchCreation {

namespace {
struct ElementwiseOpFusionPass final
: public impl::ElementwiseOpFusionPassBase<ElementwiseOpFusionPass> {
: impl::ElementwiseOpFusionPassBase<ElementwiseOpFusionPass> {
using Base::Base;
void runOnOperation() override;
};
Expand All @@ -56,7 +56,7 @@ static SmallVector<T> applyProjectedPermutation(const SmallVectorImpl<T> &input,
// relationship between the two generics. This is because the indexing
// is not affine (index values come from a tensor).
namespace {
struct GatherFusionPattern final : public OpRewritePattern<tensor::ExtractOp> {
struct GatherFusionPattern final : OpRewritePattern<tensor::ExtractOp> {
using Base::Base;
LogicalResult matchAndRewrite(tensor::ExtractOp extractOp,
PatternRewriter &rewriter) const override {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ namespace mlir::iree_compiler::DispatchCreation {
namespace {

// Move tensor.expand_shape/collapse_shape above compute_barrier.start
struct MoveReshapeAboveBarrierStart : public RewritePattern {
struct MoveReshapeAboveBarrierStart : RewritePattern {
MoveReshapeAboveBarrierStart(MLIRContext *context, PatternBenefit benefit = 1)
: RewritePattern(MatchAnyOpTypeTag(), benefit, context) {}

Expand Down Expand Up @@ -58,7 +58,7 @@ struct MoveReshapeAboveBarrierStart : public RewritePattern {

// Move tensor.expand_shape/collapse_shape below compute_barrier.end
struct MoveReshapeBelowBarrierEnd
: public OpRewritePattern<IREE::TensorExt::ComputeBarrierEndOp> {
: OpRewritePattern<IREE::TensorExt::ComputeBarrierEndOp> {
using OpRewritePattern::OpRewritePattern;

LogicalResult
Expand Down Expand Up @@ -87,7 +87,7 @@ struct MoveReshapeBelowBarrierEnd
};

struct FoldReshapesIntoTensorBarriersPass final
: public impl::FoldReshapesIntoTensorBarriersPassBase<
: impl::FoldReshapesIntoTensorBarriersPassBase<
FoldReshapesIntoTensorBarriersPass> {
using Base::Base;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -455,13 +455,12 @@ foldUnitDimsOnGlobal(IRRewriter &rewriter, IREE::Util::GlobalOpInterface global,

namespace {
struct FoldUnitExtentDimsPass final
: public impl::FoldUnitExtentDimsPassBase<FoldUnitExtentDimsPass> {
: impl::FoldUnitExtentDimsPassBase<FoldUnitExtentDimsPass> {
void runOnOperation() override;
};

struct FoldUnitExtentDimsForFuncPass final
: public impl::FoldUnitExtentDimsForFuncPassBase<
FoldUnitExtentDimsForFuncPass> {
: impl::FoldUnitExtentDimsForFuncPassBase<FoldUnitExtentDimsForFuncPass> {
void runOnOperation() override;
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1044,7 +1044,7 @@ createFusionGroups(TensorDimTrackingRewriter &rewriter,
namespace {
/// Pass declaration.
struct FormDispatchRegionsPass final
: public impl::FormDispatchRegionsPassBase<FormDispatchRegionsPass> {
: impl::FormDispatchRegionsPassBase<FormDispatchRegionsPass> {
using Base::Base;
void runOnOperation() override;
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ namespace {

/// Pass declaration.
struct FormScalarDispatchesPass final
: public impl::FormScalarDispatchesPassBase<FormScalarDispatchesPass> {
: impl::FormScalarDispatchesPassBase<FormScalarDispatchesPass> {
void runOnOperation() override;
};
} // namespace
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ namespace mlir::iree_compiler::DispatchCreation {
namespace {

struct FormSplitReductionDispatchesPass final
: public impl::FormSplitReductionDispatchesPassBase<
: impl::FormSplitReductionDispatchesPassBase<
FormSplitReductionDispatchesPass> {
using Base::Base;
void runOnOperation() override;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,7 @@ static bool operator!=(const linalg::ContractionDimensions &lhs,
}

struct FuseHorizontalContractionsPass final
: public impl::FuseHorizontalContractionsPassBase<
FuseHorizontalContractionsPass> {
: impl::FuseHorizontalContractionsPassBase<FuseHorizontalContractionsPass> {
using Base::Base;
void runOnOperation() override;
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ namespace {
/// Pass to fuse linalg on tensor operations as well as fusion of hal.interface*
/// operations with linalg.tensor_reshape operation.
struct FuseMultiUseElementwiseProducerPass final
: public impl::FuseMultiUseElementwiseProducerPassBase<
: impl::FuseMultiUseElementwiseProducerPassBase<
FuseMultiUseElementwiseProducerPass> {
using Base::Base;
void runOnOperation() override;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ namespace {

// If possible, interchange indexing maps to make input maps all identity.
struct ElementwiseOpInterchangePattern final
: public OpRewritePattern<linalg::GenericOp> {
: OpRewritePattern<linalg::GenericOp> {
using Base::Base;
LogicalResult matchAndRewrite(linalg::GenericOp genericOp,
PatternRewriter &rewriter) const override {
Expand Down Expand Up @@ -98,7 +98,7 @@ struct ElementwiseOpInterchangePattern final
/// %3 = tensor.insert_slice %a into %2
/// ```
struct FoldSuccessiveTensorInsertSliceOps final
: public OpRewritePattern<tensor::InsertSliceOp> {
: OpRewritePattern<tensor::InsertSliceOp> {
using Base::Base;
LogicalResult matchAndRewrite(tensor::InsertSliceOp sliceOp,
PatternRewriter &rewriter) const override {
Expand Down Expand Up @@ -149,7 +149,7 @@ struct FoldSuccessiveTensorInsertSliceOps final
};

struct FusionPreprocessingPass final
: public impl::FusionPreprocessingPassBase<FusionPreprocessingPass> {
: impl::FusionPreprocessingPassBase<FusionPreprocessingPass> {
void runOnOperation() override {
RewritePatternSet patterns(&getContext());
patterns.add<ElementwiseOpInterchangePattern,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -181,16 +181,15 @@ static bool isHoistableOp(Operation *op) {
namespace {
/// Pass declaration.
struct HoistEncodingOpsPass
: public impl::HoistEncodingOpsPassBase<HoistEncodingOpsPass> {
: impl::HoistEncodingOpsPassBase<HoistEncodingOpsPass> {
using Base::Base;
void runOnOperation() override;
};

/// Pattern to bubble SetEncoding ops upwards through producers. This pattern
/// runs until bubbling is not possible, or until the SetEncoding op is outside
/// of a dispatch.
struct BubbleUpSetEncodingOp
: public OpRewritePattern<IREE::Encoding::SetEncodingOp> {
struct BubbleUpSetEncodingOp : OpRewritePattern<IREE::Encoding::SetEncodingOp> {
using Base::Base;

LogicalResult matchAndRewrite(IREE::Encoding::SetEncodingOp encodingOp,
Expand All @@ -215,8 +214,7 @@ struct BubbleUpSetEncodingOp
};

/// Pattern to sink UnsetEncoding ops down through consumers.
struct SinkUnsetEncodingOp
: public OpRewritePattern<IREE::Encoding::UnsetEncodingOp> {
struct SinkUnsetEncodingOp : OpRewritePattern<IREE::Encoding::UnsetEncodingOp> {
using Base::Base;

LogicalResult matchAndRewrite(IREE::Encoding::UnsetEncodingOp encodingOp,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ static bool isUniformScalarForDispatch(Operation *op, Operation *dispatch) {
namespace {

struct HoistUniformScalarComputePass
: public DispatchCreation::impl::HoistUniformScalarComputePassBase<
: DispatchCreation::impl::HoistUniformScalarComputePassBase<
HoistUniformScalarComputePass> {
void runOnOperation() override {
mlir::FunctionOpInterface funcOp = getOperation();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ static void collectInputsToComputeRegion(Value val,
}

struct InsertTensorBarriersPass final
: public impl::InsertTensorBarriersPassBase<InsertTensorBarriersPass> {
: impl::InsertTensorBarriersPassBase<InsertTensorBarriersPass> {
using Base::Base;

void runOnOperation() override {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ static LogicalResult createDefaultWorkgroupCountRegion(

namespace {
struct MaterializeDefaultWorkgroupCountRegionPass
: public impl::MaterializeDefaultWorkgroupCountRegionPassBase<
: impl::MaterializeDefaultWorkgroupCountRegionPassBase<
MaterializeDefaultWorkgroupCountRegionPass> {
using Base::Base;
void runOnOperation() override;
Expand Down
2 changes: 1 addition & 1 deletion compiler/src/iree/compiler/DispatchCreation/Passes.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ enum class EncodingOptions { Padding, Generic };
// Pipelines
//===----------------------------------------------------------------------===//

struct TransformOptions : public PassPipelineOptions<TransformOptions> {
struct TransformOptions : PassPipelineOptions<TransformOptions> {
Option<bool> enableAggressiveFusion{
*this,
"aggressive-fusion",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ namespace {

/// Pattern to swap `tensor.cast` -> `iree_encoding.set_encoding`.
struct SwapEncodingOpWithTensorCastOp
: public OpRewritePattern<IREE::Encoding::SetEncodingOp> {
: OpRewritePattern<IREE::Encoding::SetEncodingOp> {
using Base::Base;
LogicalResult matchAndRewrite(IREE::Encoding::SetEncodingOp encodingOp,
PatternRewriter &rewriter) const override {
Expand All @@ -94,7 +94,7 @@ struct SwapEncodingOpWithTensorCastOp
// TODO(#20179): Support the propagation through interfaces. It is supposed to
// be done with data-flow analysis.
struct PropagateEncodingsPass
: public DispatchCreation::impl::PropagateEncodingsPassBase<
: DispatchCreation::impl::PropagateEncodingsPassBase<
PropagateEncodingsPass> {
void runOnOperation() override;
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ namespace mlir::iree_compiler::DispatchCreation {
namespace {

struct RemoveTensorBarriersPass final
: public impl::RemoveTensorBarriersPassBase<RemoveTensorBarriersPass> {
: impl::RemoveTensorBarriersPassBase<RemoveTensorBarriersPass> {
using Base::Base;

void runOnOperation() override {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -445,7 +445,7 @@ getArgCompareReductionSizes(PartialReductionOpInterface op,
}

struct SetSplitReductionSizesPass final
: public impl::SetSplitReductionSizesPassBase<SetSplitReductionSizesPass> {
: impl::SetSplitReductionSizesPassBase<SetSplitReductionSizesPass> {
using Base::Base;
void runOnOperation() override {
// Skip pass if no target is set.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,7 @@ namespace mlir::iree_compiler::DispatchCreation {

namespace {

struct SinkReshapesPass final
: public impl::SinkReshapesPassBase<SinkReshapesPass> {
struct SinkReshapesPass final : impl::SinkReshapesPassBase<SinkReshapesPass> {
using Base::Base;
void runOnOperation() override;
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ static LogicalResult splitReductionOnMatmul(

namespace {
struct SplitReductionPass final
: public impl::SplitReductionPassBase<SplitReductionPass> {
: impl::SplitReductionPassBase<SplitReductionPass> {
void runOnOperation() override {
if (splitMatmulReductionRatio.getValue() <= 1 &&
topkSplitReductionRatio.empty() &&
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ namespace {
/// Pattern to convert a tensor.tensor operation into a fill +
/// tensor.insert_slice. This is needed till tensor.pad op can be fused with its
/// consumers.
struct TensorPadOpConversion : public OpRewritePattern<tensor::PadOp> {
struct TensorPadOpConversion : OpRewritePattern<tensor::PadOp> {
using Base::Base;
TensorPadOpConversion(MLIRContext *context, bool skipSingleLinalgOpUses)
: OpRewritePattern<tensor::PadOp>(context, skipSingleLinalgOpUses),
Expand Down Expand Up @@ -90,7 +90,7 @@ struct TensorPadOpConversion : public OpRewritePattern<tensor::PadOp> {
};

struct TensorPadToTensorInsertSlicePass final
: public impl::TensorPadToTensorInsertSlicePassBase<
: impl::TensorPadToTensorInsertSlicePassBase<
TensorPadToTensorInsertSlicePass> {
using Base::Base;
void runOnOperation() override {
Expand Down
Loading
Loading