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 @@ -1459,11 +1459,11 @@
iree_compiler_error_t *(*onCrashCallback)(
iree_compiler_output_t **outOutput, void *userData),
void *userData) {
struct StreamImpl : public mlir::ReproducerStream {
struct StreamImpl : mlir::ReproducerStream {
StreamImpl(iree_compiler_output_t *output) : output(output) {
unwrap(output)->keep();
}
~StreamImpl() { ireeCompilerOutputDestroy(output); }

Check warning on line 1466 in compiler/src/iree/compiler/API/Internal/CompilerDriver.cpp

View workflow job for this annotation

GitHub Actions / clang-tidy

compiler/src/iree/compiler/API/Internal/CompilerDriver.cpp:1466:5 [modernize-use-override]

annotate this function with 'override' or (rarely) 'final'

llvm::StringRef description() override {
return unwrap(output)->description;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ enum class InvocationModel {
CoarseFences,
};

struct InvocationOptions : public PassPipelineOptions<InvocationOptions> {
struct InvocationOptions : PassPipelineOptions<InvocationOptions> {
Option<InvocationModel> invocationModel{
*this,
"invocation-model",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ struct EncodingCastableOpPropagationInterfaceHelper {
/// All dimensions are parallel with identity indexing maps.
template <typename ConcreteType>
struct EncodingFusionOpInterfaceAdapter
: public IREE::LinalgExt::LinalgFusionOpInterface::ExternalModel<
: IREE::LinalgExt::LinalgFusionOpInterface::ExternalModel<
EncodingFusionOpInterfaceAdapter<ConcreteType>, ConcreteType> {
SmallVector<AffineMap> getIndexingMapsForOperands(Operation *op) const {
int64_t rank = cast<ConcreteType>(op).getResultType().getRank();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,9 @@ namespace {
//===----------------------------------------------------------------------===//

template <typename IDOp>
struct IDOpValueBoundsInterface : public ValueBoundsOpInterface::ExternalModel<
IDOpValueBoundsInterface<IDOp>, IDOp> {
struct IDOpValueBoundsInterface
: ValueBoundsOpInterface::ExternalModel<IDOpValueBoundsInterface<IDOp>,
IDOp> {
void populateBoundsForIndexValue(Operation *op, Value value,
ValueBoundsConstraintSet &cstr) const {
auto boundOp = cast<IDOp>(op);
Expand All @@ -41,7 +42,7 @@ struct IDOpValueBoundsInterface : public ValueBoundsOpInterface::ExternalModel<

template <typename CountOp>
struct CountOpValueBoundsInterface
: public ValueBoundsOpInterface::ExternalModel<
: ValueBoundsOpInterface::ExternalModel<
CountOpValueBoundsInterface<CountOp>, CountOp> {
void populateBoundsForIndexValue(Operation *op, Value value,
ValueBoundsConstraintSet &cstr) const {
Expand All @@ -60,7 +61,7 @@ struct CountOpValueBoundsInterface

// External model to make util.call ops with fence arguments timeline-aware.
struct TimelineAwareCallExternalModel
: public IREE::Stream::TimelineAwareOpInterface::ExternalModel<
: IREE::Stream::TimelineAwareOpInterface::ExternalModel<
TimelineAwareCallExternalModel, IREE::Util::CallOp> {
static void add(MLIRContext *context) {
IREE::Util::CallOp::attachInterface<TimelineAwareCallExternalModel>(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ namespace {
// Used to register the LinalgFusionOpInterface with the linalg ops.
template <typename ConcreteType>
struct LinalgFusionOpInterfaceAdapter
: public IREE::LinalgExt::LinalgFusionOpInterface::ExternalModel<
: IREE::LinalgExt::LinalgFusionOpInterface::ExternalModel<
LinalgFusionOpInterfaceAdapter<ConcreteType>, ConcreteType> {
public:
SmallVector<AffineMap> getIndexingMapsForOperands(mlir::Operation *op) const {
Expand Down Expand Up @@ -65,7 +65,7 @@ struct LinalgFusionOpInterfaceAdapter
};

struct SoftmaxFusionOpInterfaceAdapter
: public IREE::LinalgExt::LinalgFusionOpInterface::ExternalModel<
: IREE::LinalgExt::LinalgFusionOpInterface::ExternalModel<
SoftmaxFusionOpInterfaceAdapter, linalg::SoftmaxOp> {
public:
SmallVector<AffineMap> getIndexingMapsForOperands(mlir::Operation *op) const {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ namespace {

template <typename OpT>
struct PreferCloneToConsumersStreamableOpExternalModel
: public IREE::Stream::StreamableOpInterface::ExternalModel<
: IREE::Stream::StreamableOpInterface::ExternalModel<
PreferCloneToConsumersStreamableOpExternalModel<OpT>, OpT> {
static void add(MLIRContext *context) {
OpT::template attachInterface<
Expand All @@ -31,7 +31,7 @@ struct PreferCloneToConsumersStreamableOpExternalModel
};

struct FlowDispatchStreamableOpExternalModel
: public IREE::Stream::StreamableOpInterface::ExternalModel<
: IREE::Stream::StreamableOpInterface::ExternalModel<
FlowDispatchStreamableOpExternalModel, IREE::Flow::DispatchOp> {
static void add(MLIRContext *context) {
IREE::Flow::DispatchOp::attachInterface<
Expand All @@ -51,7 +51,7 @@ struct FlowDispatchStreamableOpExternalModel

template <typename OpT>
struct OptionalOpAffinityAttrExternalModel
: public IREE::Stream::AffinityOpInterface::ExternalModel<
: IREE::Stream::AffinityOpInterface::ExternalModel<
OptionalOpAffinityAttrExternalModel<OpT>, OpT> {
static void add(MLIRContext *context) {
OpT::template attachInterface<OptionalOpAffinityAttrExternalModel<OpT>>(
Expand Down Expand Up @@ -87,7 +87,7 @@ struct OptionalOpAffinityAttrExternalModel
};

struct FlowBarrierTargetAffinityAttrExternalModel
: public IREE::Stream::AffinityOpInterface::ExternalModel<
: IREE::Stream::AffinityOpInterface::ExternalModel<
FlowBarrierTargetAffinityAttrExternalModel,
IREE::Flow::TensorBarrierOp> {
static void add(MLIRContext *context) {
Expand Down Expand Up @@ -117,7 +117,7 @@ struct FlowBarrierTargetAffinityAttrExternalModel
};

struct FlowTransferTargetAffinityAttrExternalModel
: public IREE::Stream::AffinityOpInterface::ExternalModel<
: IREE::Stream::AffinityOpInterface::ExternalModel<
FlowTransferTargetAffinityAttrExternalModel,
IREE::Flow::TensorTransferOp> {
static void add(MLIRContext *context) {
Expand All @@ -144,7 +144,7 @@ struct FlowTransferTargetAffinityAttrExternalModel

template <typename OpT>
struct HALTensorAffinityAttrExternalModel
: public IREE::Stream::AffinityOpInterface::ExternalModel<
: IREE::Stream::AffinityOpInterface::ExternalModel<
HALTensorAffinityAttrExternalModel<OpT>, OpT> {
static void add(MLIRContext *context) {
OpT::template attachInterface<HALTensorAffinityAttrExternalModel<OpT>>(
Expand Down Expand Up @@ -178,7 +178,7 @@ struct HALTensorAffinityAttrExternalModel

template <typename OpT>
struct GlobalOpAffinityAttrExternalModel
: public IREE::Stream::AffinityOpInterface::ExternalModel<
: IREE::Stream::AffinityOpInterface::ExternalModel<
GlobalOpAffinityAttrExternalModel<OpT>, OpT> {
static void add(MLIRContext *context) {
OpT::template attachInterface<GlobalOpAffinityAttrExternalModel<OpT>>(
Expand Down Expand Up @@ -215,7 +215,7 @@ struct GlobalOpAffinityAttrExternalModel

template <typename OpT, bool kRequiresAffinity = true>
struct AffinityOpAttrExternalModel
: public IREE::Stream::AffinityOpInterface::ExternalModel<
: IREE::Stream::AffinityOpInterface::ExternalModel<
AffinityOpAttrExternalModel<OpT, kRequiresAffinity>, OpT> {
static void add(MLIRContext *context) {
OpT::template attachInterface<
Expand Down Expand Up @@ -248,7 +248,7 @@ struct AffinityOpAttrExternalModel
};

struct TensorAffinityTypeExternalModel
: public IREE::Stream::AffinityTypeInterface::ExternalModel<
: IREE::Stream::AffinityTypeInterface::ExternalModel<
TensorAffinityTypeExternalModel, RankedTensorType> {
static void add(MLIRContext *context) {
RankedTensorType::attachInterface<TensorAffinityTypeExternalModel>(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ namespace {
//===----------------------------------------------------------------------===//

struct DispatchTensorLoadOpInterface
: public ValueBoundsOpInterface::ExternalModel<
: ValueBoundsOpInterface::ExternalModel<
DispatchTensorLoadOpInterface,
IREE::TensorExt::DispatchTensorLoadOp> {
void populateBoundsForShapedValueDim(Operation *op, Value value, int64_t dim,
Expand All @@ -33,7 +33,7 @@ struct DispatchTensorLoadOpInterface
};

struct WorkloadOrdinalOpInterface
: public ValueBoundsOpInterface::ExternalModel<
: ValueBoundsOpInterface::ExternalModel<
WorkloadOrdinalOpInterface,
IREE::TensorExt::DispatchWorkloadOrdinalOp> {
void populateBoundsForIndexValue(Operation *op, Value value,
Expand All @@ -49,7 +49,7 @@ struct WorkloadOrdinalOpInterface
//===----------------------------------------------------------------------===//

struct EncodingTypeExternalModel
: public IREE::Encoding::EncodingTypeInterface::ExternalModel<
: IREE::Encoding::EncodingTypeInterface::ExternalModel<
EncodingTypeExternalModel, IREE::TensorExt::DispatchTensorType> {

Type getEncodingType(Type type) const {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ static SmallVector<IREE::Util::ConstantIntDivisibility> getResultDivisibilities(
}

struct AffineApplyInferIntDivisibilityOpInterface
: public IREE::Util::InferIntDivisibilityOpInterface::ExternalModel<
: IREE::Util::InferIntDivisibilityOpInterface::ExternalModel<
AffineApplyInferIntDivisibilityOpInterface, affine::AffineApplyOp> {

void inferResultDivisibility(
Expand Down Expand Up @@ -255,7 +255,7 @@ static void inferAffineMinOrMaxResultDivisibility(
}

struct AffineMinInferIntDivisibilityOpInterface
: public IREE::Util::InferIntDivisibilityOpInterface::ExternalModel<
: IREE::Util::InferIntDivisibilityOpInterface::ExternalModel<
AffineMinInferIntDivisibilityOpInterface, affine::AffineMinOp> {

void inferResultDivisibility(
Expand All @@ -267,7 +267,7 @@ struct AffineMinInferIntDivisibilityOpInterface
};

struct AffineMaxInferIntDivisibilityOpInterface
: public IREE::Util::InferIntDivisibilityOpInterface::ExternalModel<
: IREE::Util::InferIntDivisibilityOpInterface::ExternalModel<
AffineMaxInferIntDivisibilityOpInterface, affine::AffineMaxOp> {

void inferResultDivisibility(
Expand All @@ -279,7 +279,7 @@ struct AffineMaxInferIntDivisibilityOpInterface
};

struct ArithConstantInferIntDivisibilityOpInterface
: public IREE::Util::InferIntDivisibilityOpInterface::ExternalModel<
: IREE::Util::InferIntDivisibilityOpInterface::ExternalModel<
ArithConstantInferIntDivisibilityOpInterface, arith::ConstantOp> {

void inferResultDivisibility(
Expand All @@ -298,7 +298,7 @@ struct ArithConstantInferIntDivisibilityOpInterface
};

struct ArithMulIInferIntDivisibilityOpInterface
: public IREE::Util::InferIntDivisibilityOpInterface::ExternalModel<
: IREE::Util::InferIntDivisibilityOpInterface::ExternalModel<
ArithMulIInferIntDivisibilityOpInterface, arith::MulIOp> {

void inferResultDivisibility(
Expand All @@ -318,7 +318,7 @@ struct ArithMulIInferIntDivisibilityOpInterface
};

struct ArithDivUIInferIntDivisibilityOpInterface
: public IREE::Util::InferIntDivisibilityOpInterface::ExternalModel<
: IREE::Util::InferIntDivisibilityOpInterface::ExternalModel<
ArithDivUIInferIntDivisibilityOpInterface, arith::DivUIOp> {

void inferResultDivisibility(
Expand Down Expand Up @@ -351,8 +351,8 @@ struct ArithDivUIInferIntDivisibilityOpInterface

/// For some reason, this interface has to be done as an external model.
struct UtilAssumeIntValueBoundsOpInterface
: public ValueBoundsOpInterface::ExternalModel<
UtilAssumeIntValueBoundsOpInterface, IREE::Util::AssumeIntOp> {
: ValueBoundsOpInterface::ExternalModel<UtilAssumeIntValueBoundsOpInterface,
IREE::Util::AssumeIntOp> {
void populateBoundsForIndexValue(Operation *op, Value value,
ValueBoundsConstraintSet &cstr) const {
auto assumeOp = cast<IREE::Util::AssumeIntOp>(op);
Expand Down Expand Up @@ -393,7 +393,7 @@ struct UtilAssumeIntValueBoundsOpInterface
//===----------------------------------------------------------------------===//

struct GlobalOpInterfaceExternalModel
: public IREE::Util::GlobalOpInterface::ExternalModel<
: IREE::Util::GlobalOpInterface::ExternalModel<
GlobalOpInterfaceExternalModel, ml_program::GlobalOp> {
Attribute getGlobalInitialValue(Operation *op) const {
return cast<ml_program::GlobalOp>(op).getValueAttr();
Expand Down Expand Up @@ -461,8 +461,8 @@ struct GlobalOpInterfaceExternalModel
struct GenericNumericCastExternalModel {
template <typename OpTy>
struct ExternalModel
: public IREE::Util::NumericCastOpInterface::ExternalModel<
ExternalModel<OpTy>, OpTy> {};
: IREE::Util::NumericCastOpInterface::ExternalModel<ExternalModel<OpTy>,
OpTy> {};

template <typename OpTy>
static void add(MLIRContext *context) {
Expand All @@ -481,8 +481,8 @@ struct GenericNumericCastExternalModel {
//===----------------------------------------------------------------------===//

struct InsertSliceOpTiedOpInterface
: public IREE::Util::TiedOpInterface::ExternalModel<
InsertSliceOpTiedOpInterface, tensor::InsertSliceOp> {
: IREE::Util::TiedOpInterface::ExternalModel<InsertSliceOpTiedOpInterface,
tensor::InsertSliceOp> {
Value getTiedResult(Operation *op, unsigned resultIndex) const {
auto insertSliceOp = cast<tensor::InsertSliceOp>(op);
return IREE::Util::TiedOpInterface::findTiedBaseValue(
Expand All @@ -501,8 +501,8 @@ struct InsertSliceOpTiedOpInterface

template <typename OpTy>
struct LinalgOpTiedOpInterface
: public IREE::Util::TiedOpInterface::ExternalModel<
LinalgOpTiedOpInterface<OpTy>, OpTy> {
: IREE::Util::TiedOpInterface::ExternalModel<LinalgOpTiedOpInterface<OpTy>,
OpTy> {
Value getTiedResult(Operation *op, unsigned resultIndex) const {
auto linalgOp = cast<OpTy>(op);
return IREE::Util::TiedOpInterface::findTiedBaseValue(
Expand Down Expand Up @@ -541,16 +541,15 @@ struct LinalgOpTiedOpInterfaceHelper {
//===----------------------------------------------------------------------===//

template <typename OpTy>
struct UnhoistableOpInterface
: public IREE::Util::HoistableOpInterface::ExternalModel<
UnhoistableOpInterface<OpTy>, OpTy> {
struct UnhoistableOpInterface : IREE::Util::HoistableOpInterface::ExternalModel<
UnhoistableOpInterface<OpTy>, OpTy> {
bool isHoistableOp(Operation *) const { return false; }
bool isHoistableLeafOp(Operation *) const { return false; }
};

template <typename OpTy>
struct HoistableNonLeafOpInterface
: public IREE::Util::HoistableOpInterface::ExternalModel<
: IREE::Util::HoistableOpInterface::ExternalModel<
HoistableNonLeafOpInterface<OpTy>, OpTy> {
bool isHoistableLeafOp(Operation *) const { return false; }
};
Expand All @@ -560,12 +559,12 @@ struct HoistableNonLeafOpInterface
// first.
template <typename OpTy>
struct AlwaysHoistableOpInterface
: public IREE::Util::HoistableOpInterface::ExternalModel<
: IREE::Util::HoistableOpInterface::ExternalModel<
AlwaysHoistableOpInterface<OpTy>, OpTy> {};

template <typename OpTy>
struct HoistableLinalgOpInterface
: public IREE::Util::HoistableOpInterface::ExternalModel<
: IREE::Util::HoistableOpInterface::ExternalModel<
HoistableLinalgOpInterface<OpTy>, OpTy> {
bool isHoistableOp(Operation *) const { return true; }

Expand Down Expand Up @@ -644,7 +643,7 @@ struct HoistableLinalgOpInterfaceHelper {

// External model for scf.for operation.
struct SCFForOpMutableRegionBranchOpInterface
: public IREE::Util::MutableRegionBranchOpInterface::ExternalModel<
: IREE::Util::MutableRegionBranchOpInterface::ExternalModel<
SCFForOpMutableRegionBranchOpInterface, scf::ForOp> {
Operation *rebuildWithExpandedTypes(
Operation *op,
Expand Down Expand Up @@ -760,7 +759,7 @@ struct SCFForOpMutableRegionBranchOpInterface

// External model for scf.if operation.
struct SCFIfOpMutableRegionBranchOpInterface
: public IREE::Util::MutableRegionBranchOpInterface::ExternalModel<
: IREE::Util::MutableRegionBranchOpInterface::ExternalModel<
SCFIfOpMutableRegionBranchOpInterface, scf::IfOp> {
Operation *rebuildWithExpandedTypes(
Operation *op,
Expand Down Expand Up @@ -861,7 +860,7 @@ struct SCFIfOpMutableRegionBranchOpInterface

// External model for scf.while operation.
struct SCFWhileOpMutableRegionBranchOpInterface
: public IREE::Util::MutableRegionBranchOpInterface::ExternalModel<
: IREE::Util::MutableRegionBranchOpInterface::ExternalModel<
SCFWhileOpMutableRegionBranchOpInterface, scf::WhileOp> {
Operation *rebuildWithExpandedTypes(
Operation *op,
Expand Down Expand Up @@ -1015,7 +1014,7 @@ struct SCFWhileOpMutableRegionBranchOpInterface

// External model for scf.index_switch operation.
struct SCFIndexSwitchOpMutableRegionBranchOpInterface
: public IREE::Util::MutableRegionBranchOpInterface::ExternalModel<
: IREE::Util::MutableRegionBranchOpInterface::ExternalModel<
SCFIndexSwitchOpMutableRegionBranchOpInterface, scf::IndexSwitchOp> {
Operation *rebuildWithExpandedTypes(
Operation *op,
Expand Down Expand Up @@ -1143,7 +1142,7 @@ struct SCFIndexSwitchOpMutableRegionBranchOpInterface
// nested operations are hoistable (checked via atomic hoisting).
template <typename OpTy>
struct RegionControlFlowHoistableOpInterface
: public IREE::Util::HoistableOpInterface::ExternalModel<
: IREE::Util::HoistableOpInterface::ExternalModel<
RegionControlFlowHoistableOpInterface<OpTy>, OpTy> {
bool isHoistableOp(Operation *op) const {
// Control flow is hoistable if all nested operations are hoistable.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ class ConvertStridedContractionToContraction
};

struct ConvertStridedContractionToContractionPass
: public impl::ConvertStridedContractionToContractionPassBase<
: impl::ConvertStridedContractionToContractionPassBase<
ConvertStridedContractionToContractionPass> {
void getDependentDialects(DialectRegistry &registry) const override {
registry.insert<arith::ArithDialect, tensor::TensorDialect>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ namespace mlir::iree_compiler::GlobalOptimization {
namespace {

struct DataLayoutPropagationPass
: public impl::DataLayoutPropagationPassBase<DataLayoutPropagationPass> {
: impl::DataLayoutPropagationPassBase<DataLayoutPropagationPass> {
void runOnOperation() override {
MLIRContext *context = &getContext();
FunctionOpInterface funcOp = getOperation();
Expand Down
Loading
Loading