forked from OSchip/llvm-project
Remove the explicit "friend Operation" statement from each of the derived operations now that op casting is no longer inside of Operation.
-- PiperOrigin-RevId: 247791672
This commit is contained in:
parent
d5b60ee840
commit
d7c467ded1
|
@ -31,7 +31,6 @@ class RangeOp : public mlir::Op<RangeOp, mlir::OpTrait::NOperands<3>::Impl,
|
|||
mlir::OpTrait::OneResult,
|
||||
mlir::OpTrait::HasNoSideEffect> {
|
||||
public:
|
||||
friend mlir::Operation;
|
||||
using Op::Op;
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
|
|
@ -30,7 +30,6 @@ class SliceOp : public mlir::Op<SliceOp, mlir::OpTrait::NOperands<2>::Impl,
|
|||
mlir::OpTrait::OneResult,
|
||||
mlir::OpTrait::HasNoSideEffect> {
|
||||
public:
|
||||
friend mlir::Operation;
|
||||
using Op::Op;
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
|
|
@ -32,7 +32,6 @@ class ViewOp : public mlir::Op<ViewOp, mlir::OpTrait::VariadicOperands,
|
|||
mlir::OpTrait::OneResult,
|
||||
mlir::OpTrait::HasNoSideEffect> {
|
||||
public:
|
||||
friend mlir::Operation;
|
||||
using Op::Op;
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
|
|
@ -103,7 +103,6 @@ class DotOp : public TensorContractionBase<DotOp>,
|
|||
public mlir::Op<DotOp, mlir::OpTrait::VariadicOperands,
|
||||
mlir::OpTrait::ZeroResult> {
|
||||
public:
|
||||
friend mlir::Operation;
|
||||
using Op::Op;
|
||||
using TensorContractionBaseType =
|
||||
TensorContractionBase::TensorContractionBaseType;
|
||||
|
@ -165,7 +164,6 @@ class MatvecOp : public TensorContractionBase<MatvecOp>,
|
|||
public mlir::Op<MatvecOp, mlir::OpTrait::VariadicOperands,
|
||||
mlir::OpTrait::ZeroResult> {
|
||||
public:
|
||||
friend mlir::Operation;
|
||||
using Op::Op;
|
||||
using TensorContractionBaseType =
|
||||
TensorContractionBase::TensorContractionBaseType;
|
||||
|
@ -227,7 +225,6 @@ class MatmulOp : public TensorContractionBase<MatmulOp>,
|
|||
public mlir::Op<MatmulOp, mlir::OpTrait::VariadicOperands,
|
||||
mlir::OpTrait::ZeroResult> {
|
||||
public:
|
||||
friend mlir::Operation;
|
||||
using Op::Op;
|
||||
using TensorContractionBaseType =
|
||||
TensorContractionBase::TensorContractionBaseType;
|
||||
|
|
|
@ -30,7 +30,6 @@ class ViewType;
|
|||
class LoadOp : public mlir::Op<LoadOp, mlir::OpTrait::VariadicOperands,
|
||||
mlir::OpTrait::OneResult> {
|
||||
public:
|
||||
friend mlir::Operation;
|
||||
using Op::Op;
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -61,7 +60,6 @@ public:
|
|||
class StoreOp : public mlir::Op<StoreOp, mlir::OpTrait::VariadicOperands,
|
||||
mlir::OpTrait::ZeroResult> {
|
||||
public:
|
||||
friend mlir::Operation;
|
||||
using Op::Op;
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
|
|
@ -145,7 +145,6 @@ public:
|
|||
mlir::FloatAttr value);
|
||||
|
||||
/// Inherit constructor.
|
||||
friend mlir::Operation;
|
||||
using Op::Op;
|
||||
};
|
||||
|
||||
|
@ -182,7 +181,6 @@ public:
|
|||
llvm::StringRef getCalleeName();
|
||||
|
||||
/// Inherit constructor.
|
||||
friend mlir::Operation;
|
||||
using Op::Op;
|
||||
};
|
||||
|
||||
|
@ -212,7 +210,6 @@ public:
|
|||
mlir::Value *getOperand() { return getOperation()->getOperand(0); }
|
||||
|
||||
/// Inherit constructor.
|
||||
friend mlir::Operation;
|
||||
using Op::Op;
|
||||
};
|
||||
|
||||
|
@ -233,7 +230,6 @@ public:
|
|||
mlir::Value *value);
|
||||
|
||||
/// Inherit constructor.
|
||||
friend mlir::Operation;
|
||||
using Op::Op;
|
||||
};
|
||||
|
||||
|
@ -253,7 +249,6 @@ public:
|
|||
mlir::Value *value);
|
||||
|
||||
/// Inherit constructor.
|
||||
friend mlir::Operation;
|
||||
using Op::Op;
|
||||
};
|
||||
|
||||
|
@ -278,7 +273,6 @@ public:
|
|||
mlir::Value *value, ToyArrayType reshapedType);
|
||||
|
||||
/// Inherit constructor.
|
||||
friend mlir::Operation;
|
||||
using Op::Op;
|
||||
};
|
||||
|
||||
|
@ -307,7 +301,6 @@ public:
|
|||
mlir::Value *getRHS() { return getOperand(1); }
|
||||
|
||||
/// Inherit constructor.
|
||||
friend mlir::Operation;
|
||||
using Op::Op;
|
||||
};
|
||||
|
||||
|
@ -334,7 +327,6 @@ public:
|
|||
mlir::Value *getRHS() { return getOperand(1); }
|
||||
|
||||
/// Inherit constructor.
|
||||
friend mlir::Operation;
|
||||
using Op::Op;
|
||||
};
|
||||
|
||||
|
|
|
@ -145,7 +145,6 @@ public:
|
|||
mlir::FloatAttr value);
|
||||
|
||||
/// Inherit constructor.
|
||||
friend mlir::Operation;
|
||||
using Op::Op;
|
||||
};
|
||||
|
||||
|
@ -182,7 +181,6 @@ public:
|
|||
llvm::StringRef getCalleeName();
|
||||
|
||||
/// Inherit constructor.
|
||||
friend mlir::Operation;
|
||||
using Op::Op;
|
||||
};
|
||||
|
||||
|
@ -212,7 +210,6 @@ public:
|
|||
mlir::Value *getOperand() { return getOperation()->getOperand(0); }
|
||||
|
||||
/// Inherit constructor.
|
||||
friend mlir::Operation;
|
||||
using Op::Op;
|
||||
};
|
||||
|
||||
|
@ -233,7 +230,6 @@ public:
|
|||
mlir::Value *value);
|
||||
|
||||
/// Inherit constructor.
|
||||
friend mlir::Operation;
|
||||
using Op::Op;
|
||||
};
|
||||
|
||||
|
@ -259,7 +255,6 @@ public:
|
|||
mlir::MLIRContext *context);
|
||||
|
||||
/// Inherit constructor.
|
||||
friend mlir::Operation;
|
||||
using Op::Op;
|
||||
};
|
||||
|
||||
|
@ -290,7 +285,6 @@ public:
|
|||
mlir::MLIRContext *context);
|
||||
|
||||
/// Inherit constructor.
|
||||
friend mlir::Operation;
|
||||
using Op::Op;
|
||||
};
|
||||
|
||||
|
@ -320,7 +314,6 @@ public:
|
|||
mlir::Value *getRHS() { return getOperand(1); }
|
||||
|
||||
/// Inherit constructor.
|
||||
friend mlir::Operation;
|
||||
using Op::Op;
|
||||
};
|
||||
|
||||
|
@ -348,7 +341,6 @@ public:
|
|||
mlir::Value *getRHS() { return getOperand(1); }
|
||||
|
||||
/// Inherit constructor.
|
||||
friend mlir::Operation;
|
||||
using Op::Op;
|
||||
};
|
||||
|
||||
|
|
|
@ -153,7 +153,6 @@ public:
|
|||
}
|
||||
|
||||
/// Inherit constructor.
|
||||
friend mlir::Operation;
|
||||
using Op::Op;
|
||||
};
|
||||
|
||||
|
@ -190,7 +189,6 @@ public:
|
|||
llvm::StringRef getCalleeName();
|
||||
|
||||
/// Inherit constructor.
|
||||
friend mlir::Operation;
|
||||
using Op::Op;
|
||||
};
|
||||
|
||||
|
@ -220,7 +218,6 @@ public:
|
|||
mlir::Value *getOperand() { return getOperation()->getOperand(0); }
|
||||
|
||||
/// Inherit constructor.
|
||||
friend mlir::Operation;
|
||||
using Op::Op;
|
||||
};
|
||||
|
||||
|
@ -241,7 +238,6 @@ public:
|
|||
mlir::Value *value);
|
||||
|
||||
/// Inherit constructor.
|
||||
friend mlir::Operation;
|
||||
using Op::Op;
|
||||
};
|
||||
|
||||
|
@ -267,7 +263,6 @@ public:
|
|||
mlir::MLIRContext *context);
|
||||
|
||||
/// Inherit constructor.
|
||||
friend mlir::Operation;
|
||||
using Op::Op;
|
||||
};
|
||||
|
||||
|
@ -298,7 +293,6 @@ public:
|
|||
mlir::MLIRContext *context);
|
||||
|
||||
/// Inherit constructor.
|
||||
friend mlir::Operation;
|
||||
using Op::Op;
|
||||
};
|
||||
|
||||
|
@ -328,7 +322,6 @@ public:
|
|||
mlir::Value *getRHS() { return getOperand(1); }
|
||||
|
||||
/// Inherit constructor.
|
||||
friend mlir::Operation;
|
||||
using Op::Op;
|
||||
};
|
||||
|
||||
|
@ -356,7 +349,6 @@ public:
|
|||
mlir::Value *getRHS() { return getOperand(1); }
|
||||
|
||||
/// Inherit constructor.
|
||||
friend mlir::Operation;
|
||||
using Op::Op;
|
||||
};
|
||||
|
||||
|
@ -374,7 +366,6 @@ public:
|
|||
mlir::Type retType);
|
||||
|
||||
/// Inherit constructor.
|
||||
friend mlir::Operation;
|
||||
using Op::Op;
|
||||
};
|
||||
|
||||
|
@ -394,7 +385,6 @@ public:
|
|||
mlir::MLIRContext *context);
|
||||
|
||||
/// Inherit constructor.
|
||||
friend mlir::Operation;
|
||||
using Op::Op;
|
||||
};
|
||||
|
||||
|
|
|
@ -214,7 +214,6 @@ class GenericCallOp
|
|||
llvm::StringRef getCalleeName();
|
||||
|
||||
private:
|
||||
friend class mlir::Operation;
|
||||
using Op::Op;
|
||||
};
|
||||
```
|
||||
|
|
|
@ -60,7 +60,6 @@ public:
|
|||
class AffineApplyOp : public Op<AffineApplyOp, OpTrait::VariadicOperands,
|
||||
OpTrait::OneResult, OpTrait::HasNoSideEffect> {
|
||||
public:
|
||||
friend Operation;
|
||||
using Op::Op;
|
||||
|
||||
/// Builds an affine apply op with the specified map and operands.
|
||||
|
@ -120,7 +119,6 @@ public:
|
|||
class AffineForOp
|
||||
: public Op<AffineForOp, OpTrait::VariadicOperands, OpTrait::ZeroResult> {
|
||||
public:
|
||||
friend Operation;
|
||||
using Op::Op;
|
||||
|
||||
// Hooks to customize behavior of this op.
|
||||
|
@ -307,7 +305,6 @@ private:
|
|||
class AffineIfOp
|
||||
: public Op<AffineIfOp, OpTrait::VariadicOperands, OpTrait::ZeroResult> {
|
||||
public:
|
||||
friend Operation;
|
||||
using Op::Op;
|
||||
|
||||
// Hooks to customize behavior of this op.
|
||||
|
@ -341,15 +338,11 @@ class AffineTerminatorOp
|
|||
: public Op<AffineTerminatorOp, OpTrait::ZeroOperands, OpTrait::ZeroResult,
|
||||
OpTrait::IsTerminator> {
|
||||
public:
|
||||
friend Operation;
|
||||
using Op::Op;
|
||||
|
||||
static void build(Builder *, OperationState *) {}
|
||||
|
||||
static StringRef getOperationName() { return "affine.terminator"; }
|
||||
|
||||
private:
|
||||
friend Operation;
|
||||
};
|
||||
|
||||
/// Returns true if the given Value can be used as a dimension id.
|
||||
|
|
|
@ -59,7 +59,6 @@ class LaunchOp : public Op<LaunchOp, OpTrait::AtLeastNOperands<6>::Impl,
|
|||
OpTrait::ZeroResult,
|
||||
OpTrait::NthRegionIsIsolatedAbove<0>::Impl> {
|
||||
public:
|
||||
friend Operation;
|
||||
using Op::Op;
|
||||
|
||||
static void build(Builder *builder, OperationState *result, Value *gridSizeX,
|
||||
|
|
|
@ -832,7 +832,6 @@ public:
|
|||
explicit Op(Operation *state) : OpState(state) {
|
||||
assert(!state || isa<ConcreteOpType>(state));
|
||||
}
|
||||
friend class Operation;
|
||||
|
||||
private:
|
||||
template <typename... Types> struct BaseVerifier;
|
||||
|
|
|
@ -37,7 +37,6 @@ namespace linalg {
|
|||
class BufferAllocOp
|
||||
: public Op<BufferAllocOp, OpTrait::OneOperand, OpTrait::OneResult> {
|
||||
public:
|
||||
friend Operation;
|
||||
using Op::Op;
|
||||
|
||||
// Hooks to customize the behavior of this op.
|
||||
|
@ -61,7 +60,6 @@ public:
|
|||
class BufferDeallocOp
|
||||
: public Op<BufferDeallocOp, OpTrait::OneOperand, OpTrait::ZeroResult> {
|
||||
public:
|
||||
friend Operation;
|
||||
using Op::Op;
|
||||
|
||||
// Hooks to customize the behavior of this op.
|
||||
|
@ -87,7 +85,6 @@ public:
|
|||
class LoadOp
|
||||
: public Op<LoadOp, OpTrait::VariadicOperands, OpTrait::OneResult> {
|
||||
public:
|
||||
friend Operation;
|
||||
using Op::Op;
|
||||
|
||||
// Hooks to customize the behavior of this op.
|
||||
|
@ -116,7 +113,6 @@ public:
|
|||
class RangeOp : public Op<RangeOp, OpTrait::NOperands<3>::Impl,
|
||||
OpTrait::OneResult, OpTrait::HasNoSideEffect> {
|
||||
public:
|
||||
friend Operation;
|
||||
using Op::Op;
|
||||
|
||||
// Hooks to customize the behavior of this op.
|
||||
|
@ -177,7 +173,6 @@ class SliceOp : public Op<SliceOp, OpTrait::VariadicOperands,
|
|||
enum { FirstIndexingOperand = 1 };
|
||||
|
||||
public:
|
||||
friend Operation;
|
||||
using Op::Op;
|
||||
|
||||
// Hooks to customize the behavior of this op.
|
||||
|
@ -215,7 +210,6 @@ public:
|
|||
class StoreOp
|
||||
: public Op<StoreOp, OpTrait::VariadicOperands, OpTrait::ZeroResult> {
|
||||
public:
|
||||
friend Operation;
|
||||
using Op::Op;
|
||||
|
||||
// Hooks to customize the behavior of this op.
|
||||
|
@ -254,7 +248,6 @@ class ViewOp : public Op<ViewOp, OpTrait::VariadicOperands, OpTrait::OneResult,
|
|||
enum { FirstIndexingOperand = 1 };
|
||||
|
||||
public:
|
||||
friend Operation;
|
||||
using Op::Op;
|
||||
|
||||
// Hooks to customize the behavior of this op.
|
||||
|
|
|
@ -91,7 +91,6 @@ class CmpIOp
|
|||
OpTrait::OneResult, OpTrait::ResultsAreBoolLike,
|
||||
OpTrait::SameOperandsAndResultShape, OpTrait::HasNoSideEffect> {
|
||||
public:
|
||||
friend Operation;
|
||||
using Op::Op;
|
||||
|
||||
CmpIPredicate getPredicate() {
|
||||
|
@ -208,7 +207,6 @@ class CondBranchOp : public Op<CondBranchOp, OpTrait::AtLeastNOperands<1>::Impl,
|
|||
/// follows:
|
||||
/// { condition, [true_operands], [false_operands] }
|
||||
public:
|
||||
friend Operation;
|
||||
using Op::Op;
|
||||
|
||||
static StringRef getOperationName() { return "std.cond_br"; }
|
||||
|
@ -300,7 +298,6 @@ private:
|
|||
///
|
||||
class ConstantFloatOp : public ConstantOp {
|
||||
public:
|
||||
friend Operation;
|
||||
using ConstantOp::ConstantOp;
|
||||
|
||||
/// Builds a constant float op producing a float of the specified type.
|
||||
|
@ -319,7 +316,6 @@ public:
|
|||
///
|
||||
class ConstantIntOp : public ConstantOp {
|
||||
public:
|
||||
friend Operation;
|
||||
using ConstantOp::ConstantOp;
|
||||
/// Build a constant int op producing an integer of the specified width.
|
||||
static void build(Builder *builder, OperationState *result, int64_t value,
|
||||
|
@ -342,7 +338,6 @@ public:
|
|||
///
|
||||
class ConstantIndexOp : public ConstantOp {
|
||||
public:
|
||||
friend Operation;
|
||||
using ConstantOp::ConstantOp;
|
||||
|
||||
/// Build a constant int op producing an index.
|
||||
|
@ -393,7 +388,6 @@ public:
|
|||
class DmaStartOp
|
||||
: public Op<DmaStartOp, OpTrait::VariadicOperands, OpTrait::ZeroResult> {
|
||||
public:
|
||||
friend Operation;
|
||||
using Op::Op;
|
||||
|
||||
static void build(Builder *builder, OperationState *result, Value *srcMemRef,
|
||||
|
@ -519,7 +513,6 @@ public:
|
|||
class DmaWaitOp
|
||||
: public Op<DmaWaitOp, OpTrait::VariadicOperands, OpTrait::ZeroResult> {
|
||||
public:
|
||||
friend Operation;
|
||||
using Op::Op;
|
||||
|
||||
static void build(Builder *builder, OperationState *result, Value *tagMemRef,
|
||||
|
@ -561,7 +554,6 @@ public:
|
|||
class LoadOp
|
||||
: public Op<LoadOp, OpTrait::VariadicOperands, OpTrait::OneResult> {
|
||||
public:
|
||||
friend Operation;
|
||||
using Op::Op;
|
||||
|
||||
// Hooks to customize behavior of this op.
|
||||
|
@ -604,7 +596,6 @@ public:
|
|||
///
|
||||
class MemRefCastOp : public CastOp<MemRefCastOp> {
|
||||
public:
|
||||
friend Operation;
|
||||
using CastOp::CastOp;
|
||||
static StringRef getOperationName() { return "std.memref_cast"; }
|
||||
|
||||
|
@ -632,7 +623,6 @@ public:
|
|||
class ReturnOp : public Op<ReturnOp, OpTrait::VariadicOperands,
|
||||
OpTrait::ZeroResult, OpTrait::IsTerminator> {
|
||||
public:
|
||||
friend Operation;
|
||||
using Op::Op;
|
||||
|
||||
static StringRef getOperationName() { return "std.return"; }
|
||||
|
@ -660,7 +650,6 @@ public:
|
|||
class SelectOp : public Op<SelectOp, OpTrait::NOperands<3>::Impl,
|
||||
OpTrait::OneResult, OpTrait::HasNoSideEffect> {
|
||||
public:
|
||||
friend Operation;
|
||||
using Op::Op;
|
||||
|
||||
static StringRef getOperationName() { return "std.select"; }
|
||||
|
@ -690,7 +679,6 @@ public:
|
|||
class StoreOp
|
||||
: public Op<StoreOp, OpTrait::VariadicOperands, OpTrait::ZeroResult> {
|
||||
public:
|
||||
friend Operation;
|
||||
using Op::Op;
|
||||
|
||||
// Hooks to customize behavior of this op.
|
||||
|
@ -731,7 +719,6 @@ public:
|
|||
///
|
||||
class TensorCastOp : public CastOp<TensorCastOp> {
|
||||
public:
|
||||
friend Operation;
|
||||
using CastOp::CastOp;
|
||||
|
||||
static StringRef getOperationName() { return "std.tensor_cast"; }
|
||||
|
|
|
@ -93,7 +93,6 @@ class VectorTransferReadOp
|
|||
enum Offsets : unsigned { MemRefOffset = 0, FirstIndexOffset = 1 };
|
||||
|
||||
public:
|
||||
friend Operation;
|
||||
using Op::Op;
|
||||
|
||||
static StringRef getOperationName() { return "vector.transfer_read"; }
|
||||
|
@ -158,7 +157,6 @@ class VectorTransferWriteOp
|
|||
};
|
||||
|
||||
public:
|
||||
friend Operation;
|
||||
using Op::Op;
|
||||
|
||||
static StringRef getOperationName() { return "vector.transfer_write"; }
|
||||
|
@ -194,7 +192,6 @@ public:
|
|||
class VectorTypeCastOp
|
||||
: public Op<VectorTypeCastOp, OpTrait::OneOperand, OpTrait::OneResult> {
|
||||
public:
|
||||
friend Operation;
|
||||
using Op::Op;
|
||||
|
||||
static StringRef getOperationName() { return "vector.type_cast"; }
|
||||
|
|
|
@ -304,7 +304,6 @@ void OpClass::writeDeclTo(raw_ostream &os) const {
|
|||
for (const auto &trait : traits)
|
||||
os << ", " << trait;
|
||||
os << "> {\npublic:\n";
|
||||
os << " friend Operation;\n";
|
||||
os << " using Op::Op;\n";
|
||||
for (const auto &method : methods) {
|
||||
method.writeDeclTo(os);
|
||||
|
|
Loading…
Reference in New Issue