diff --git a/mlir/docs/Tutorials/Toy/Ch-2.md b/mlir/docs/Tutorials/Toy/Ch-2.md --- a/mlir/docs/Tutorials/Toy/Ch-2.md +++ b/mlir/docs/Tutorials/Toy/Ch-2.md @@ -369,7 +369,7 @@ // * The parent dialect of the operation. // * The mnemonic for the operation, or the name without the dialect prefix. // * A list of traits for the operation. -class Toy_Op traits = []> : +class Toy_Op traits = []> : Op; ``` diff --git a/mlir/examples/standalone/include/Standalone/StandaloneDialect.td b/mlir/examples/standalone/include/Standalone/StandaloneDialect.td --- a/mlir/examples/standalone/include/Standalone/StandaloneDialect.td +++ b/mlir/examples/standalone/include/Standalone/StandaloneDialect.td @@ -30,7 +30,7 @@ // Base standalone operation definition. //===----------------------------------------------------------------------===// -class Standalone_Op traits = []> : +class Standalone_Op traits = []> : Op; #endif // STANDALONE_DIALECT diff --git a/mlir/examples/toy/Ch2/include/toy/Ops.td b/mlir/examples/toy/Ch2/include/toy/Ops.td --- a/mlir/examples/toy/Ch2/include/toy/Ops.td +++ b/mlir/examples/toy/Ch2/include/toy/Ops.td @@ -28,7 +28,7 @@ // * The parent dialect of the operation. // * The mnemonic for the operation, or the name without the dialect prefix. // * A list of traits for the operation. -class Toy_Op traits = []> : +class Toy_Op traits = []> : Op; //===----------------------------------------------------------------------===// diff --git a/mlir/examples/toy/Ch3/include/toy/Ops.td b/mlir/examples/toy/Ch3/include/toy/Ops.td --- a/mlir/examples/toy/Ch3/include/toy/Ops.td +++ b/mlir/examples/toy/Ch3/include/toy/Ops.td @@ -27,7 +27,7 @@ // * The parent dialect of the operation. // * The mnemonic for the operation, or the name without the dialect prefix. // * A list of traits for the operation. -class Toy_Op traits = []> : +class Toy_Op traits = []> : Op; //===----------------------------------------------------------------------===// diff --git a/mlir/examples/toy/Ch4/include/toy/Ops.td b/mlir/examples/toy/Ch4/include/toy/Ops.td --- a/mlir/examples/toy/Ch4/include/toy/Ops.td +++ b/mlir/examples/toy/Ch4/include/toy/Ops.td @@ -30,7 +30,7 @@ // * The parent dialect of the operation. // * The mnemonic for the operation, or the name without the dialect prefix. // * A list of traits for the operation. -class Toy_Op traits = []> : +class Toy_Op traits = []> : Op; //===----------------------------------------------------------------------===// diff --git a/mlir/examples/toy/Ch5/include/toy/Ops.td b/mlir/examples/toy/Ch5/include/toy/Ops.td --- a/mlir/examples/toy/Ch5/include/toy/Ops.td +++ b/mlir/examples/toy/Ch5/include/toy/Ops.td @@ -30,7 +30,7 @@ // * The parent dialect of the operation. // * The mnemonic for the operation, or the name without the dialect prefix. // * A list of traits for the operation. -class Toy_Op traits = []> : +class Toy_Op traits = []> : Op; //===----------------------------------------------------------------------===// diff --git a/mlir/examples/toy/Ch6/include/toy/Ops.td b/mlir/examples/toy/Ch6/include/toy/Ops.td --- a/mlir/examples/toy/Ch6/include/toy/Ops.td +++ b/mlir/examples/toy/Ch6/include/toy/Ops.td @@ -30,7 +30,7 @@ // * The parent dialect of the operation. // * The mnemonic for the operation, or the name without the dialect prefix. // * A list of traits for the operation. -class Toy_Op traits = []> : +class Toy_Op traits = []> : Op; //===----------------------------------------------------------------------===// diff --git a/mlir/examples/toy/Ch7/include/toy/Ops.td b/mlir/examples/toy/Ch7/include/toy/Ops.td --- a/mlir/examples/toy/Ch7/include/toy/Ops.td +++ b/mlir/examples/toy/Ch7/include/toy/Ops.td @@ -34,7 +34,7 @@ // * The parent dialect of the operation. // * The mnemonic for the operation, or the name without the dialect prefix. // * A list of traits for the operation. -class Toy_Op traits = []> : +class Toy_Op traits = []> : Op; // Provide a definition for the Toy StructType for use in ODS. This allows for diff --git a/mlir/include/mlir/Dialect/AMX/AMX.td b/mlir/include/mlir/Dialect/AMX/AMX.td --- a/mlir/include/mlir/Dialect/AMX/AMX.td +++ b/mlir/include/mlir/Dialect/AMX/AMX.td @@ -61,11 +61,11 @@ // AMX Op and IntrOp definitions. //===----------------------------------------------------------------------===// -class AMX_Op traits = []> : +class AMX_Op traits = []> : Op {} // The "internal" intrinsics are meant for compiler usage. -class AMX_IntrOp traits = []> : +class AMX_IntrOp traits = []> : LLVM_IntrOpBase; diff --git a/mlir/include/mlir/Dialect/Affine/IR/AffineOps.td b/mlir/include/mlir/Dialect/Affine/IR/AffineOps.td --- a/mlir/include/mlir/Dialect/Affine/IR/AffineOps.td +++ b/mlir/include/mlir/Dialect/Affine/IR/AffineOps.td @@ -27,7 +27,7 @@ } // Base class for Affine dialect ops. -class Affine_Op traits = []> : +class Affine_Op traits = []> : Op { // For every affine op, there needs to be a: // * void print(OpAsmPrinter &p, ${C++ class of Op} op) @@ -475,7 +475,7 @@ let hasFolder = 1; } -class AffineLoadOpBase traits = []> : +class AffineLoadOpBase traits = []> : Affine_Op, DeclareOpInterfaceMethods, @@ -540,7 +540,7 @@ let hasFolder = 1; } -class AffineMinMaxOpBase traits = []> : +class AffineMinMaxOpBase traits = []> : Op { let arguments = (ins AffineMapAttr:$map, Variadic:$operands); let results = (outs Index); @@ -834,7 +834,7 @@ let hasFolder = 1; } -class AffineStoreOpBase traits = []> : +class AffineStoreOpBase traits = []> : Affine_Op, DeclareOpInterfaceMethods, diff --git a/mlir/include/mlir/Dialect/Arithmetic/IR/ArithmeticOps.td b/mlir/include/mlir/Dialect/Arithmetic/IR/ArithmeticOps.td --- a/mlir/include/mlir/Dialect/Arithmetic/IR/ArithmeticOps.td +++ b/mlir/include/mlir/Dialect/Arithmetic/IR/ArithmeticOps.td @@ -18,7 +18,7 @@ // Base class for Arithmetic dialect ops. Ops in this dialect have no side // effects and can be applied element-wise to vectors and tensors. -class Arith_Op traits = []> : +class Arith_Op traits = []> : Op] # ElementwiseMappable.traits>; @@ -26,41 +26,41 @@ // Base class for integer and floating point arithmetic ops. All ops have one // result, require operands and results to be of the same type, and can accept // tensors or vectors of integers or floats. -class Arith_ArithmeticOp traits = []> : +class Arith_ArithmeticOp traits = []> : Arith_Op; // Base class for unary arithmetic operations. -class Arith_UnaryOp traits = []> : +class Arith_UnaryOp traits = []> : Arith_ArithmeticOp { let assemblyFormat = "$operand attr-dict `:` type($result)"; } // Base class for binary arithmetic operations. -class Arith_BinaryOp traits = []> : +class Arith_BinaryOp traits = []> : Arith_ArithmeticOp { let assemblyFormat = "$lhs `,` $rhs attr-dict `:` type($result)"; } // Base class for ternary arithmetic operations. -class Arith_TernaryOp traits = []> : +class Arith_TernaryOp traits = []> : Arith_ArithmeticOp { let assemblyFormat = "$a `,` $b `,` $c attr-dict `:` type($result)"; } // Base class for integer binary operations. -class Arith_IntBinaryOp traits = []> : +class Arith_IntBinaryOp traits = []> : Arith_BinaryOp, Arguments<(ins SignlessIntegerLike:$lhs, SignlessIntegerLike:$rhs)>, Results<(outs SignlessIntegerLike:$result)>; // Base class for floating point unary operations. -class Arith_FloatUnaryOp traits = []> : +class Arith_FloatUnaryOp traits = []> : Arith_UnaryOp, Arguments<(ins FloatLike:$operand)>, Results<(outs FloatLike:$result)>; // Base class for floating point binary operations. -class Arith_FloatBinaryOp traits = []> : +class Arith_FloatBinaryOp traits = []> : Arith_BinaryOp, Arguments<(ins FloatLike:$lhs, FloatLike:$rhs)>, Results<(outs FloatLike:$result)>; @@ -68,7 +68,7 @@ // Base class for arithmetic cast operations. Requires a single operand and // result. If either is a shaped type, then the other must be of the same shape. class Arith_CastOp traits = []> : + list traits = []> : Arith_Op]>, Arguments<(ins From:$in)>, @@ -91,23 +91,23 @@ "signless-fixed-width-integer-like">; // Cast from an integer type to another integer type. -class Arith_IToICastOp traits = []> : +class Arith_IToICastOp traits = []> : Arith_CastOp; // Cast from an integer type to a floating point type. -class Arith_IToFCastOp traits = []> : +class Arith_IToFCastOp traits = []> : Arith_CastOp; // Cast from a floating point type to an integer type. -class Arith_FToICastOp traits = []> : +class Arith_FToICastOp traits = []> : Arith_CastOp; // Cast from a floating point type to another floating point type. -class Arith_FToFCastOp traits = []> : +class Arith_FToFCastOp traits = []> : Arith_CastOp; // Base class for compare operations. Requires two operands of the same type // and returns a single `BoolLike` result. If the operand type is a vector or // tensor, then the result will be one of `i1` of the same shape. -class Arith_CompareOp traits = []> : +class Arith_CompareOp traits = []> : Arith_Op]> { @@ -118,7 +118,7 @@ // Just like `Arith_CompareOp` but also admits 0-D vectors. Introduced // temporarily to allow gradual transition to 0-D vectors. -class Arith_CompareOpOfAnyRank traits = []> : +class Arith_CompareOpOfAnyRank traits = []> : Arith_CompareOp { let results = (outs BoolLikeOfAnyRank:$result); } diff --git a/mlir/include/mlir/Dialect/ArmNeon/ArmNeon.td b/mlir/include/mlir/Dialect/ArmNeon/ArmNeon.td --- a/mlir/include/mlir/Dialect/ArmNeon/ArmNeon.td +++ b/mlir/include/mlir/Dialect/ArmNeon/ArmNeon.td @@ -38,7 +38,7 @@ // intrinsic. class ArmNeon_IntrOp overloadedResults, list overloadedOperands, int numResults, - list traits = [], bit requiresAccessGroup = 0, + list traits = [], bit requiresAccessGroup = 0, bit requiresAliasScope = 0> : LLVM_IntrOpBase traits = []> + list traits = []> : ArmNeon_IntrOp; // ArmNeon dialect op that corresponds to an LLVM IR intrinsic with one // overloaded result and overloaded operands list. class ArmNeon_OverloadedOperandsWithOneResultIntrOp overloadedOperands, - list traits = []> + list traits = []> : ArmNeon_IntrOp; def SMullOp : ArmNeon_OverloadedOneResultIntrOp<"smull", [ @@ -120,7 +120,7 @@ "$a `,` $b `,` $c attr-dict `:` type($b) `,` type($c) `to` type($res)"; } -class ArmNeon_2dOp traits = []> +class ArmNeon_2dOp traits = []> : Op; diff --git a/mlir/include/mlir/Dialect/ArmSVE/ArmSVE.td b/mlir/include/mlir/Dialect/ArmSVE/ArmSVE.td --- a/mlir/include/mlir/Dialect/ArmSVE/ArmSVE.td +++ b/mlir/include/mlir/Dialect/ArmSVE/ArmSVE.td @@ -34,21 +34,21 @@ // ArmSVE op definitions //===----------------------------------------------------------------------===// -class ArmSVE_Op traits = []> : +class ArmSVE_Op traits = []> : Op {} class ArmSVE_IntrBinaryOverloadedOp traits = []> : + list traits = []> : LLVM_IntrOpBase overloadedResults=*/[0], /*list overloadedOperands=*/[], // defined by result overload - /*list traits=*/traits, + /*list traits=*/traits, /*int numResults=*/1>; class ScalableMaskedFOp traits = []> : + list traits = []> : ArmSVE_Op, TypesMatchWith< @@ -71,7 +71,7 @@ } class ScalableMaskedIOp traits = []> : + list traits = []> : ArmSVE_Op, TypesMatchWith< diff --git a/mlir/include/mlir/Dialect/Async/IR/AsyncOps.td b/mlir/include/mlir/Dialect/Async/IR/AsyncOps.td --- a/mlir/include/mlir/Dialect/Async/IR/AsyncOps.td +++ b/mlir/include/mlir/Dialect/Async/IR/AsyncOps.td @@ -23,7 +23,7 @@ //===----------------------------------------------------------------------===// // Base class for the operation in this dialect -class Async_Op traits = []> : +class Async_Op traits = []> : Op; def Async_ExecuteOp : diff --git a/mlir/include/mlir/Dialect/Bufferization/IR/BufferizationOps.td b/mlir/include/mlir/Dialect/Bufferization/IR/BufferizationOps.td --- a/mlir/include/mlir/Dialect/Bufferization/IR/BufferizationOps.td +++ b/mlir/include/mlir/Dialect/Bufferization/IR/BufferizationOps.td @@ -15,7 +15,7 @@ include "mlir/Interfaces/SideEffectInterfaces.td" include "mlir/Interfaces/CopyOpInterface.td" -class Bufferization_Op traits = []> +class Bufferization_Op traits = []> : Op; //===----------------------------------------------------------------------===// diff --git a/mlir/include/mlir/Dialect/Complex/IR/ComplexOps.td b/mlir/include/mlir/Dialect/Complex/IR/ComplexOps.td --- a/mlir/include/mlir/Dialect/Complex/IR/ComplexOps.td +++ b/mlir/include/mlir/Dialect/Complex/IR/ComplexOps.td @@ -14,13 +14,13 @@ include "mlir/Interfaces/InferTypeOpInterface.td" include "mlir/Interfaces/SideEffectInterfaces.td" -class Complex_Op traits = []> +class Complex_Op traits = []> : Op; // Base class for standard arithmetic operations on complex numbers with a // floating-point element type. These operations take two operands and return // one result, all of which must be complex numbers of the same type. -class ComplexArithmeticOp traits = []> : +class ComplexArithmeticOp traits = []> : Complex_Op { let arguments = (ins Complex:$lhs, Complex:$rhs); @@ -32,7 +32,7 @@ // Base class for standard unary operations on complex numbers with a // floating-point element type. These operations take one operand and return // one result; the operand must be a complex number. -class ComplexUnaryOp traits = []> : +class ComplexUnaryOp traits = []> : Complex_Op { let arguments = (ins Complex:$complex); let assemblyFormat = "$complex attr-dict `:` type($complex)"; diff --git a/mlir/include/mlir/Dialect/EmitC/IR/EmitC.td b/mlir/include/mlir/Dialect/EmitC/IR/EmitC.td --- a/mlir/include/mlir/Dialect/EmitC/IR/EmitC.td +++ b/mlir/include/mlir/Dialect/EmitC/IR/EmitC.td @@ -23,7 +23,7 @@ //===----------------------------------------------------------------------===// // Base class for EmitC dialect ops. -class EmitC_Op traits = []> +class EmitC_Op traits = []> : Op { let verifier = "return ::verify(*this);"; } diff --git a/mlir/include/mlir/Dialect/GPU/GPUOps.td b/mlir/include/mlir/Dialect/GPU/GPUOps.td --- a/mlir/include/mlir/Dialect/GPU/GPUOps.td +++ b/mlir/include/mlir/Dialect/GPU/GPUOps.td @@ -26,7 +26,7 @@ // GPU Dialect operations. //===----------------------------------------------------------------------===// -class GPU_Op traits = []> : +class GPU_Op traits = []> : Op; def GPU_Dimension : I32EnumAttr<"Dimension", @@ -41,7 +41,7 @@ } def GPU_DimensionAttr : EnumAttr; -class GPU_IndexOp traits = []> : +class GPU_IndexOp traits = []> : GPU_Op, Arguments<(ins GPU_DimensionAttr:$dimension)>, Results<(outs Index)> { let assemblyFormat = "$dimension attr-dict"; diff --git a/mlir/include/mlir/Dialect/LLVMIR/LLVMOpBase.td b/mlir/include/mlir/Dialect/LLVMIR/LLVMOpBase.td --- a/mlir/include/mlir/Dialect/LLVMIR/LLVMOpBase.td +++ b/mlir/include/mlir/Dialect/LLVMIR/LLVMOpBase.td @@ -158,7 +158,7 @@ // Base class for LLVM operations. Defines the interface to the llvm::IRBuilder // used to translate to LLVM IR proper. -class LLVM_OpBase traits = []> : +class LLVM_OpBase traits = []> : Op { // A pattern for constructing the LLVM IR Instruction (or other Value) that // corresponds to this op. This pattern can use `builder` to refer to an @@ -182,7 +182,7 @@ // their name automatically. LLVM operations have either zero or one result, // this class is specialized below for both cases and should not be used // directly. -class LLVM_Op traits = []> : +class LLVM_Op traits = []> : LLVM_OpBase; // Case of the LLVM enum attribute backed by I64Attr with customized string @@ -256,7 +256,7 @@ // `llvm::Intrinsic` enum; one usually wants these to be related. class LLVM_IntrOpBase overloadedResults, list overloadedOperands, - list traits, int numResults, + list traits, int numResults, bit requiresAccessGroup = 0, bit requiresAliasScope = 0> : LLVM_OpBase, Results { @@ -287,7 +287,7 @@ // Base class for LLVM intrinsic operations, should not be used directly. Places // the intrinsic into the LLVM dialect and prefixes its name with "intr.". class LLVM_IntrOp overloadedResults, - list overloadedOperands, list traits, + list overloadedOperands, list traits, int numResults, bit requiresAccessGroup = 0, bit requiresAliasScope = 0> : LLVM_IntrOpBase overloadedOperands = [], - list traits = []> + list traits = []> : LLVM_IntrOp; // Base class for LLVM intrinsic operations returning one result. Places the @@ -320,7 +320,7 @@ // empty otherwise. class LLVM_OneResultIntrOp overloadedResults = [], list overloadedOperands = [], - list traits = []> + list traits = []> : LLVM_IntrOp; // LLVM vector reduction over a single vector. diff --git a/mlir/include/mlir/Dialect/LLVMIR/LLVMOps.td b/mlir/include/mlir/Dialect/LLVMIR/LLVMOps.td --- a/mlir/include/mlir/Dialect/LLVMIR/LLVMOps.td +++ b/mlir/include/mlir/Dialect/LLVMIR/LLVMOps.td @@ -112,12 +112,12 @@ // Base class for LLVM terminator operations. All terminator operations have // zero results and an optional list of successors. -class LLVM_TerminatorOp traits = []> : +class LLVM_TerminatorOp traits = []> : LLVM_Op; // Class for arithmetic binary operations. class LLVM_ArithmeticOpBase traits = []> : + string builderFunc, list traits = []> : LLVM_Op, LLVM_Builder<"$res = builder." # builderFunc # "($lhs, $rhs);"> { @@ -128,12 +128,12 @@ let assemblyFormat = "$lhs `,` $rhs custom(attr-dict) `:` type($res)"; } class LLVM_IntArithmeticOp traits = []> : + list traits = []> : LLVM_ArithmeticOpBase { let arguments = commonArgs; } class LLVM_FloatArithmeticOp traits = []> : + list traits = []> : LLVM_ArithmeticOpBase], traits)> { dag fmfArg = (ins DefaultValuedAttr:$fastmathFlags); @@ -142,7 +142,7 @@ // Class for arithmetic unary operations. class LLVM_UnaryFloatArithmeticOp traits = []> : + string builderFunc, list traits = []> : LLVM_Op], traits)>, LLVM_Builder<"$res = builder." # builderFunc # "($operand);"> { @@ -415,7 +415,7 @@ // Casts. class LLVM_CastOp traits = []> : + Type resultType, list traits = []> : LLVM_Op, LLVM_Builder<"$res = builder." # builderFunc # "($arg, $_resultType);"> { let arguments = (ins type:$arg); @@ -1411,31 +1411,31 @@ // operations and intrinsics. However, we systematically prefix them with // "intr." to avoid potential name clashes. -class LLVM_UnaryIntrinsicOp traits = []> : +class LLVM_UnaryIntrinsicOp traits = []> : LLVM_OneResultIntrOp { let arguments = (ins LLVM_Type:$in); } -class LLVM_BinarySameArgsIntrinsicOp traits = []> : +class LLVM_BinarySameArgsIntrinsicOp traits = []> : LLVM_OneResultIntrOp { let arguments = (ins LLVM_Type:$a, LLVM_Type:$b); } -class LLVM_BinaryIntrinsicOp traits = []> : +class LLVM_BinaryIntrinsicOp traits = []> : LLVM_OneResultIntrOp { let arguments = (ins LLVM_Type:$a, LLVM_Type:$b); } -class LLVM_TernarySameArgsIntrinsicOp traits = []> : +class LLVM_TernarySameArgsIntrinsicOp traits = []> : LLVM_OneResultIntrOp { let arguments = (ins LLVM_Type:$a, LLVM_Type:$b, LLVM_Type:$c); } -class LLVM_CountZerosIntrinsicOp traits = []> : +class LLVM_CountZerosIntrinsicOp traits = []> : LLVM_OneResultIntrOp { let arguments = (ins LLVM_Type:$in, I<1>:$zero_undefined); diff --git a/mlir/include/mlir/Dialect/LLVMIR/NVVMOps.td b/mlir/include/mlir/Dialect/LLVMIR/NVVMOps.td --- a/mlir/include/mlir/Dialect/LLVMIR/NVVMOps.td +++ b/mlir/include/mlir/Dialect/LLVMIR/NVVMOps.td @@ -43,7 +43,7 @@ // NVVM op definitions //===----------------------------------------------------------------------===// -class NVVM_Op traits = []> : +class NVVM_Op traits = []> : LLVM_OpBase { } @@ -52,7 +52,7 @@ //===----------------------------------------------------------------------===// class NVVM_IntrOp overloadedResults, - list overloadedOperands, list traits, + list overloadedOperands, list traits, int numResults> : LLVM_IntrOpBase; @@ -63,7 +63,7 @@ //===----------------------------------------------------------------------===// class NVVM_SpecialRegisterOp traits = []> : + list traits = []> : NVVM_IntrOp, Arguments<(ins)> { let assemblyFormat = "attr-dict `:` type($res)"; diff --git a/mlir/include/mlir/Dialect/LLVMIR/ROCDLOps.td b/mlir/include/mlir/Dialect/LLVMIR/ROCDLOps.td --- a/mlir/include/mlir/Dialect/LLVMIR/ROCDLOps.td +++ b/mlir/include/mlir/Dialect/LLVMIR/ROCDLOps.td @@ -37,7 +37,7 @@ // ROCDL op definitions //===----------------------------------------------------------------------===// -class ROCDL_Op traits = []> : +class ROCDL_Op traits = []> : LLVM_OpBase { } @@ -46,7 +46,7 @@ //===----------------------------------------------------------------------===// class ROCDL_SpecialRegisterOp traits = []> : + list traits = []> : ROCDL_Op, Results<(outs LLVM_Type:$res)>, Arguments<(ins)> { string llvmBuilder = "$res = createIntrinsicCall(builder," @@ -55,7 +55,7 @@ } class ROCDL_DeviceFunctionOp traits = []> : + int parameter, list traits = []> : ROCDL_Op, Results<(outs LLVM_Type:$res)>, Arguments<(ins)> { string llvmBuilder = "$res = createDeviceFunctionCall(builder, \"" @@ -113,7 +113,7 @@ //===---------------------------------------------------------------------===// // Xdlops intrinsics -class ROCDL_Mfma_IntrOp traits = []> : +class ROCDL_Mfma_IntrOp traits = []> : LLVM_IntrOpBase, diff --git a/mlir/include/mlir/Dialect/Linalg/IR/LinalgOps.td b/mlir/include/mlir/Dialect/Linalg/IR/LinalgOps.td --- a/mlir/include/mlir/Dialect/Linalg/IR/LinalgOps.td +++ b/mlir/include/mlir/Dialect/Linalg/IR/LinalgOps.td @@ -21,7 +21,7 @@ include "mlir/Interfaces/ViewLikeInterface.td" // Base class for Linalg dialect ops that do not correspond to library calls. -class Linalg_Op traits = []> : +class Linalg_Op traits = []> : Op { // For every linalg op, there needs to be a: // * void print(OpAsmPrinter &p, ${C++ class of Op} op) diff --git a/mlir/include/mlir/Dialect/Linalg/IR/LinalgStructuredOps.td b/mlir/include/mlir/Dialect/Linalg/IR/LinalgStructuredOps.td --- a/mlir/include/mlir/Dialect/Linalg/IR/LinalgStructuredOps.td +++ b/mlir/include/mlir/Dialect/Linalg/IR/LinalgStructuredOps.td @@ -24,7 +24,7 @@ // Linalg ops that correspond to library calls operate on ShapedType as their // first operands. These may be optionally followed by non-view operands // depending on the specific Linalg op. -class LinalgStructuredBase_Op props> +class LinalgStructuredBase_Op props> : Op, DeclareOpInterfaceMethods, @@ -44,7 +44,7 @@ }]; } -class LinalgStructured_Op props> +class LinalgStructured_Op props> : LinalgStructuredBase_Op { code structuredOpsDecls = structuredOpsBaseDecls # [{ std::string getLibraryCallName() { diff --git a/mlir/include/mlir/Dialect/Math/IR/MathOps.td b/mlir/include/mlir/Dialect/Math/IR/MathOps.td --- a/mlir/include/mlir/Dialect/Math/IR/MathOps.td +++ b/mlir/include/mlir/Dialect/Math/IR/MathOps.td @@ -16,7 +16,7 @@ // Base class for math dialect ops. Ops in this dialect have no side effects and // can be applied element-wise to vectors and tensors. -class Math_Op traits = []> : +class Math_Op traits = []> : Op] # ElementwiseMappable.traits>; @@ -24,7 +24,7 @@ // Base class for unary math operations on integer types. Require a operand and // result of the same type. This type can be an integer type, or vector or tensor // thereof. -class Math_IntegerUnaryOp traits = []> : +class Math_IntegerUnaryOp traits = []> : Math_Op { let arguments = (ins SignlessIntegerLike:$operand); let results = (outs SignlessIntegerLike:$result); @@ -35,7 +35,7 @@ // Base class for unary math operations on floating point types. Require a // operand and result of the same type. This type can be a floating point type, // or vector or tensor thereof. -class Math_FloatUnaryOp traits = []> : +class Math_FloatUnaryOp traits = []> : Math_Op { let arguments = (ins FloatLike:$operand); let results = (outs FloatLike:$result); @@ -46,7 +46,7 @@ // Base class for binary math operations on floating point types. Require two // operands and one result of the same type. This type can be a floating point // type, or a vector or tensor thereof. -class Math_FloatBinaryOp traits = []> : +class Math_FloatBinaryOp traits = []> : Math_Op { let arguments = (ins FloatLike:$lhs, FloatLike:$rhs); let results = (outs FloatLike:$result); @@ -57,7 +57,7 @@ // Base class for floating point ternary operations. Require three operands and // one result of the same type. This type can be a floating point type, or a // vector or tensor thereof. -class Math_FloatTernaryOp traits = []> : +class Math_FloatTernaryOp traits = []> : Math_Op { let arguments = (ins FloatLike:$a, FloatLike:$b, FloatLike:$c); let results = (outs FloatLike:$result); diff --git a/mlir/include/mlir/Dialect/MemRef/IR/MemRefOps.td b/mlir/include/mlir/Dialect/MemRef/IR/MemRefOps.td --- a/mlir/include/mlir/Dialect/MemRef/IR/MemRefOps.td +++ b/mlir/include/mlir/Dialect/MemRef/IR/MemRefOps.td @@ -25,7 +25,7 @@ let constBuilderCall = "::mlir::TypeAttr::get($0)"; } -class MemRef_Op traits = []> +class MemRef_Op traits = []> : Op { let printer = [{ return ::print(p, *this); }]; let verifier = [{ return ::verify(*this); }]; @@ -42,7 +42,7 @@ // class AllocLikeOp traits = []> : + list traits = []> : MemRef_Op traits = []> : +class MemRef_ReassociativeReshapeOp traits = []> : MemRef_Op, Arguments<(ins AnyStridedMemRef:$src, IndexListArrayAttr:$reassociation)>, diff --git a/mlir/include/mlir/Dialect/OpenACC/OpenACCOps.td b/mlir/include/mlir/Dialect/OpenACC/OpenACCOps.td --- a/mlir/include/mlir/Dialect/OpenACC/OpenACCOps.td +++ b/mlir/include/mlir/Dialect/OpenACC/OpenACCOps.td @@ -33,7 +33,7 @@ include "mlir/Dialect/OpenACC/AccCommon.td" // Base class for OpenACC dialect ops. -class OpenACC_Op traits = []> : +class OpenACC_Op traits = []> : Op { let printer = [{ return ::print(p, *this); }]; diff --git a/mlir/include/mlir/Dialect/OpenMP/OpenMPOps.td b/mlir/include/mlir/Dialect/OpenMP/OpenMPOps.td --- a/mlir/include/mlir/Dialect/OpenMP/OpenMPOps.td +++ b/mlir/include/mlir/Dialect/OpenMP/OpenMPOps.td @@ -32,7 +32,7 @@ // OmpCommon requires definition of OpenACC_Dialect. include "mlir/Dialect/OpenMP/OmpCommon.td" -class OpenMP_Op traits = []> : +class OpenMP_Op traits = []> : Op; // Type which can be constraint accepting standard integers and indices. diff --git a/mlir/include/mlir/Dialect/PDL/IR/PDLOps.td b/mlir/include/mlir/Dialect/PDL/IR/PDLOps.td --- a/mlir/include/mlir/Dialect/PDL/IR/PDLOps.td +++ b/mlir/include/mlir/Dialect/PDL/IR/PDLOps.td @@ -22,7 +22,7 @@ // PDL Ops //===----------------------------------------------------------------------===// -class PDL_Op traits = []> +class PDL_Op traits = []> : Op { let printer = [{ ::print(p, *this); }]; let parser = [{ return ::parse$cppClass(parser, result); }]; diff --git a/mlir/include/mlir/Dialect/PDLInterp/IR/PDLInterpOps.td b/mlir/include/mlir/Dialect/PDLInterp/IR/PDLInterpOps.td --- a/mlir/include/mlir/Dialect/PDLInterp/IR/PDLInterpOps.td +++ b/mlir/include/mlir/Dialect/PDLInterp/IR/PDLInterpOps.td @@ -53,7 +53,7 @@ //===----------------------------------------------------------------------===// // Generic interpreter operation. -class PDLInterp_Op traits = []> : +class PDLInterp_Op traits = []> : Op; //===----------------------------------------------------------------------===// @@ -61,7 +61,7 @@ // Check operations evaluate a predicate on a positional value and then // conditionally branch on the result. -class PDLInterp_PredicateOp traits = []> : +class PDLInterp_PredicateOp traits = []> : PDLInterp_Op { let successors = (successor AnySuccessor:$trueDest, AnySuccessor:$falseDest); } @@ -71,7 +71,7 @@ // Switch operations evaluate a predicate on a positional value and then // conditionally branch on the result. -class PDLInterp_SwitchOp traits = []> : +class PDLInterp_SwitchOp traits = []> : PDLInterp_Op { let successors = (successor AnySuccessor:$defaultDest, VariadicSuccessor:$cases); diff --git a/mlir/include/mlir/Dialect/Quant/QuantOps.td b/mlir/include/mlir/Dialect/Quant/QuantOps.td --- a/mlir/include/mlir/Dialect/Quant/QuantOps.td +++ b/mlir/include/mlir/Dialect/Quant/QuantOps.td @@ -21,7 +21,7 @@ // Base classes //===----------------------------------------------------------------------===// -class quant_Op traits> : +class quant_Op traits> : Op; //===----------------------------------------------------------------------===// diff --git a/mlir/include/mlir/Dialect/SCF/SCFOps.td b/mlir/include/mlir/Dialect/SCF/SCFOps.td --- a/mlir/include/mlir/Dialect/SCF/SCFOps.td +++ b/mlir/include/mlir/Dialect/SCF/SCFOps.td @@ -25,7 +25,7 @@ } // Base class for SCF dialect ops. -class SCF_Op traits = []> : +class SCF_Op traits = []> : Op { // For every standard op, there needs to be a: // * void print(OpAsmPrinter &p, ${C++ class of Op} op) diff --git a/mlir/include/mlir/Dialect/SPIRV/IR/SPIRVArithmeticOps.td b/mlir/include/mlir/Dialect/SPIRV/IR/SPIRVArithmeticOps.td --- a/mlir/include/mlir/Dialect/SPIRV/IR/SPIRVArithmeticOps.td +++ b/mlir/include/mlir/Dialect/SPIRV/IR/SPIRVArithmeticOps.td @@ -19,7 +19,7 @@ include "mlir/Interfaces/SideEffectInterfaces.td" class SPV_ArithmeticBinaryOp traits = []> : + list traits = []> : // Operands type same as result type. SPV_BinaryOp traits = []> : + list traits = []> : // Operand type same as result type. SPV_UnaryOp traits = []> : +class SPV_AtomicUpdateOp traits = []> : SPV_Op { let parser = [{ return ::parseAtomicUpdateOp(parser, result, false); }]; let printer = [{ return ::printAtomicUpdateOp(getOperation(), p); }]; @@ -31,7 +31,7 @@ ); } -class SPV_AtomicUpdateWithValueOp traits = []> : +class SPV_AtomicUpdateWithValueOp traits = []> : SPV_Op { let parser = [{ return ::parseAtomicUpdateOp(parser, result, true); }]; let printer = [{ return ::printAtomicUpdateOp(getOperation(), p); }]; diff --git a/mlir/include/mlir/Dialect/SPIRV/IR/SPIRVBase.td b/mlir/include/mlir/Dialect/SPIRV/IR/SPIRVBase.td --- a/mlir/include/mlir/Dialect/SPIRV/IR/SPIRVBase.td +++ b/mlir/include/mlir/Dialect/SPIRV/IR/SPIRVBase.td @@ -4248,7 +4248,7 @@ //===----------------------------------------------------------------------===// // Base class for all SPIR-V ops. -class SPV_Op traits = []> : +class SPV_Op traits = []> : Op traits = []> : + list traits = []> : SPV_Op { let arguments = (ins SPV_ScalarOrVectorOf:$operand @@ -4327,7 +4327,7 @@ } class SPV_BinaryOp traits = []> : + list traits = []> : SPV_Op { let arguments = (ins SPV_ScalarOrVectorOf:$operand1, @@ -4345,7 +4345,7 @@ } class SPV_ExtInstOp traits = []> : + int opcode, list traits = []> : SPV_Op { // Extended instruction sets have no direct opcode (they share the diff --git a/mlir/include/mlir/Dialect/SPIRV/IR/SPIRVBitOps.td b/mlir/include/mlir/Dialect/SPIRV/IR/SPIRVBitOps.td --- a/mlir/include/mlir/Dialect/SPIRV/IR/SPIRVBitOps.td +++ b/mlir/include/mlir/Dialect/SPIRV/IR/SPIRVBitOps.td @@ -17,13 +17,13 @@ include "mlir/Dialect/SPIRV/IR/SPIRVBase.td" include "mlir/Interfaces/SideEffectInterfaces.td" -class SPV_BitBinaryOp traits = []> : +class SPV_BitBinaryOp traits = []> : // All the operands type used in bit instructions are SPV_Integer. SPV_BinaryOp; -class SPV_BitFieldExtractOp traits = []> : +class SPV_BitFieldExtractOp traits = []> : SPV_Op])> { let arguments = (ins @@ -43,12 +43,12 @@ }]; } -class SPV_BitUnaryOp traits = []> : +class SPV_BitUnaryOp traits = []> : SPV_UnaryOp; -class SPV_ShiftOp traits = []> : +class SPV_ShiftOp traits = []> : SPV_BinaryOp { diff --git a/mlir/include/mlir/Dialect/SPIRV/IR/SPIRVCastOps.td b/mlir/include/mlir/Dialect/SPIRV/IR/SPIRVCastOps.td --- a/mlir/include/mlir/Dialect/SPIRV/IR/SPIRVCastOps.td +++ b/mlir/include/mlir/Dialect/SPIRV/IR/SPIRVCastOps.td @@ -18,7 +18,7 @@ include "mlir/Interfaces/SideEffectInterfaces.td" class SPV_CastOp traits = []> : + list traits = []> : SPV_Op { diff --git a/mlir/include/mlir/Dialect/SPIRV/IR/SPIRVGLSLOps.td b/mlir/include/mlir/Dialect/SPIRV/IR/SPIRVGLSLOps.td --- a/mlir/include/mlir/Dialect/SPIRV/IR/SPIRVGLSLOps.td +++ b/mlir/include/mlir/Dialect/SPIRV/IR/SPIRVGLSLOps.td @@ -21,7 +21,7 @@ //===----------------------------------------------------------------------===// // Base class for all GLSL ops. -class SPV_GLSLOp traits = []> : +class SPV_GLSLOp traits = []> : SPV_ExtInstOp { let availability = [ @@ -34,7 +34,7 @@ // Base class for GLSL unary ops. class SPV_GLSLUnaryOp traits = []> : + Type operandType, list traits = []> : SPV_GLSLOp { let arguments = (ins @@ -55,12 +55,12 @@ // Base class for GLSL Unary arithmetic ops where return type matches // the operand type. class SPV_GLSLUnaryArithmeticOp traits = []> : + list traits = []> : SPV_GLSLUnaryOp; // Base class for GLSL binary ops. class SPV_GLSLBinaryOp traits = []> : + Type operandType, list traits = []> : SPV_GLSLOp { let arguments = (ins @@ -82,12 +82,12 @@ // Base class for GLSL Binary arithmetic ops where operand types and // return type matches. class SPV_GLSLBinaryArithmeticOp traits = []> : + list traits = []> : SPV_GLSLBinaryOp; // Base class for GLSL ternary ops. class SPV_GLSLTernaryArithmeticOp traits = []> : + list traits = []> : SPV_GLSLOp { let arguments = (ins diff --git a/mlir/include/mlir/Dialect/SPIRV/IR/SPIRVLogicalOps.td b/mlir/include/mlir/Dialect/SPIRV/IR/SPIRVLogicalOps.td --- a/mlir/include/mlir/Dialect/SPIRV/IR/SPIRVLogicalOps.td +++ b/mlir/include/mlir/Dialect/SPIRV/IR/SPIRVLogicalOps.td @@ -18,7 +18,7 @@ include "mlir/Interfaces/SideEffectInterfaces.td" class SPV_LogicalBinaryOp traits = []> : + list traits = []> : // Result type is SPV_Bool. SPV_BinaryOp traits = []> : + list traits = []> : // Result type is SPV_Bool. SPV_UnaryOp traits = []> : SPV_Op { + list traits = []> : SPV_Op { let arguments = (ins SPV_ScopeAttr:$execution_scope, diff --git a/mlir/include/mlir/Dialect/SPIRV/IR/SPIRVOCLOps.td b/mlir/include/mlir/Dialect/SPIRV/IR/SPIRVOCLOps.td --- a/mlir/include/mlir/Dialect/SPIRV/IR/SPIRVOCLOps.td +++ b/mlir/include/mlir/Dialect/SPIRV/IR/SPIRVOCLOps.td @@ -20,7 +20,7 @@ //===----------------------------------------------------------------------===// // Base class for all OpenCL ops. -class SPV_OCLOp traits = []> : +class SPV_OCLOp traits = []> : SPV_ExtInstOp { let availability = [ @@ -33,7 +33,7 @@ // Base class for OpenCL unary ops. class SPV_OCLUnaryOp traits = []> : + Type operandType, list traits = []> : SPV_OCLOp { let arguments = (ins @@ -54,12 +54,12 @@ // Base class for OpenCL Unary arithmetic ops where return type matches // the operand type. class SPV_OCLUnaryArithmeticOp traits = []> : + list traits = []> : SPV_OCLUnaryOp; // Base class for OpenCL binary ops. class SPV_OCLBinaryOp traits = []> : + Type operandType, list traits = []> : SPV_OCLOp { let arguments = (ins @@ -81,7 +81,7 @@ // Base class for OpenCL Binary arithmetic ops where operand types and // return type matches. class SPV_OCLBinaryArithmeticOp traits = []> : + list traits = []> : SPV_OCLBinaryOp; // ----- diff --git a/mlir/include/mlir/Dialect/Shape/IR/ShapeOps.td b/mlir/include/mlir/Dialect/Shape/IR/ShapeOps.td --- a/mlir/include/mlir/Dialect/Shape/IR/ShapeOps.td +++ b/mlir/include/mlir/Dialect/Shape/IR/ShapeOps.td @@ -25,7 +25,7 @@ //===----------------------------------------------------------------------===// // Base class for the operation in this dialect -class Shape_Op traits = []> : +class Shape_Op traits = []> : Op; def Shape_AddOp : Shape_Op<"add", diff --git a/mlir/include/mlir/Dialect/SparseTensor/IR/SparseTensorOps.td b/mlir/include/mlir/Dialect/SparseTensor/IR/SparseTensorOps.td --- a/mlir/include/mlir/Dialect/SparseTensor/IR/SparseTensorOps.td +++ b/mlir/include/mlir/Dialect/SparseTensor/IR/SparseTensorOps.td @@ -18,7 +18,7 @@ // Base class. //===----------------------------------------------------------------------===// -class SparseTensor_Op traits = []> +class SparseTensor_Op traits = []> : Op { let printer = [{ return ::print(p, *this); }]; let verifier = [{ return ::verify(*this); }]; diff --git a/mlir/include/mlir/Dialect/StandardOps/IR/Ops.td b/mlir/include/mlir/Dialect/StandardOps/IR/Ops.td --- a/mlir/include/mlir/Dialect/StandardOps/IR/Ops.td +++ b/mlir/include/mlir/Dialect/StandardOps/IR/Ops.td @@ -31,7 +31,7 @@ } // Base class for Standard dialect ops. -class Std_Op traits = []> : +class Std_Op traits = []> : Op { // For every standard op, there needs to be a: // * void print(OpAsmPrinter &p, ${C++ class of Op} op) @@ -46,7 +46,7 @@ // Base class for unary ops. Requires single operand and result. Individual // classes will have `operand` accessor. -class UnaryOp traits = []> : +class UnaryOp traits = []> : Op { let results = (outs AnyType); let printer = [{ @@ -55,14 +55,14 @@ } class UnaryOpSameOperandAndResultType traits = []> : + list traits = []> : UnaryOp { let parser = [{ return impl::parseOneResultSameOperandTypeOp(parser, result); }]; } -class FloatUnaryOp traits = []> : +class FloatUnaryOp traits = []> : UnaryOpSameOperandAndResultType] # ElementwiseMappable.traits>, Arguments<(ins FloatLike:$operand)>; @@ -70,7 +70,7 @@ // Base class for standard arithmetic operations. Requires operands and // results to be of the same type, but does not constrain them to specific // types. -class ArithmeticOp traits = []> : +class ArithmeticOp traits = []> : Op] # @@ -84,7 +84,7 @@ } // Base class for standard binary arithmetic operations. -class ArithmeticBinaryOp traits = []> : +class ArithmeticBinaryOp traits = []> : ArithmeticOp { let parser = [{ @@ -93,7 +93,7 @@ } // Base class for standard ternary arithmetic operations. -class ArithmeticTernaryOp traits = []> : +class ArithmeticTernaryOp traits = []> : ArithmeticOp { let parser = [{ @@ -113,7 +113,7 @@ // // i %0, %1 : i32 // -class IntBinaryOp traits = []> : +class IntBinaryOp traits = []> : ArithmeticBinaryOp])>, @@ -128,7 +128,7 @@ // // f %0, %1 : f32 // -class FloatBinaryOp traits = []> : +class FloatBinaryOp traits = []> : ArithmeticBinaryOp])>, @@ -143,7 +143,7 @@ // // %0, %1, %2 : f32 // -class FloatTernaryOp traits = []> : +class FloatTernaryOp traits = []> : ArithmeticTernaryOp])>, diff --git a/mlir/include/mlir/Dialect/Tensor/IR/TensorOps.td b/mlir/include/mlir/Dialect/Tensor/IR/TensorOps.td --- a/mlir/include/mlir/Dialect/Tensor/IR/TensorOps.td +++ b/mlir/include/mlir/Dialect/Tensor/IR/TensorOps.td @@ -17,7 +17,7 @@ include "mlir/Interfaces/TilingInterface.td" include "mlir/Interfaces/ViewLikeInterface.td" -class Tensor_Op traits = []> +class Tensor_Op traits = []> : Op { let printer = [{ return ::print(p, *this); }]; let verifier = [{ return ::verify(*this); }]; @@ -656,7 +656,7 @@ // ExpandShapeOp / CollapseShapeOp //===----------------------------------------------------------------------===// -class Tensor_ReassociativeReshapeOp traits = []> : +class Tensor_ReassociativeReshapeOp traits = []> : Tensor_Op, Arguments<(ins AnyTensor:$src, IndexListArrayAttr:$reassociation)>, Results<(outs AnyTensor:$result)> { diff --git a/mlir/include/mlir/Dialect/Tosa/IR/TosaOpBase.td b/mlir/include/mlir/Dialect/Tosa/IR/TosaOpBase.td --- a/mlir/include/mlir/Dialect/Tosa/IR/TosaOpBase.td +++ b/mlir/include/mlir/Dialect/Tosa/IR/TosaOpBase.td @@ -196,7 +196,7 @@ // TOSA Operator. //===----------------------------------------------------------------------===// -class Tosa_Op traits = []> : +class Tosa_Op traits = []> : Op { } diff --git a/mlir/include/mlir/Dialect/Vector/VectorOps.td b/mlir/include/mlir/Dialect/Vector/VectorOps.td --- a/mlir/include/mlir/Dialect/Vector/VectorOps.td +++ b/mlir/include/mlir/Dialect/Vector/VectorOps.td @@ -25,7 +25,7 @@ } // Base class for Vector dialect ops. -class Vector_Op traits = []> : +class Vector_Op traits = []> : Op { // For every vector op, there needs to be a: // * void print(OpAsmPrinter &p, ${C++ class of Op} op) diff --git a/mlir/include/mlir/Dialect/X86Vector/X86Vector.td b/mlir/include/mlir/Dialect/X86Vector/X86Vector.td --- a/mlir/include/mlir/Dialect/X86Vector/X86Vector.td +++ b/mlir/include/mlir/Dialect/X86Vector/X86Vector.td @@ -31,11 +31,11 @@ //===----------------------------------------------------------------------===// // Operation that is part of the input dialect. -class AVX512_Op traits = []> : +class AVX512_Op traits = []> : Op {} // Intrinsic operation used during lowering to LLVM IR. -class AVX512_IntrOp traits = []> : +class AVX512_IntrOp traits = []> : LLVM_IntrOpBase; @@ -43,7 +43,7 @@ // Defined by first result overload. May have to be extended for other // instructions in the future. class AVX512_IntrOverloadedOp traits = []> : + list traits = []> : LLVM_IntrOpBase overloadedResults=*/[0], @@ -276,17 +276,17 @@ //===----------------------------------------------------------------------===// // Operation that is part of the input dialect. -class AVX_Op traits = []> : +class AVX_Op traits = []> : Op {} // Operation that may be part of the input dialect, but whose // form is somewhere between the user view of the operation // and the actual lower level intrinsic in LLVM IR. -class AVX_LowOp traits = []> : +class AVX_LowOp traits = []> : Op {} // Intrinsic operation used during lowering to LLVM IR. -class AVX_IntrOp traits = []> : +class AVX_IntrOp traits = []> : LLVM_IntrOpBase; diff --git a/mlir/include/mlir/IR/BuiltinOps.td b/mlir/include/mlir/IR/BuiltinOps.td --- a/mlir/include/mlir/IR/BuiltinOps.td +++ b/mlir/include/mlir/IR/BuiltinOps.td @@ -25,7 +25,7 @@ include "mlir/Interfaces/SideEffectInterfaces.td" // Base class for Builtin dialect ops. -class Builtin_Op traits = []> : +class Builtin_Op traits = []> : Op; //===----------------------------------------------------------------------===// diff --git a/mlir/include/mlir/IR/OpBase.td b/mlir/include/mlir/IR/OpBase.td --- a/mlir/include/mlir/IR/OpBase.td +++ b/mlir/include/mlir/IR/OpBase.td @@ -1994,58 +1994,41 @@ // TypeTrait definitions //===----------------------------------------------------------------------===// -// TypeTrait represents a trait regarding a type. -// TODO: Remove this class in favor of using Trait. -class TypeTrait; - // These classes are used to define type specific traits. -class NativeTypeTrait : NativeTrait, TypeTrait; +class NativeTypeTrait : NativeTrait; class ParamNativeTypeTrait - : ParamNativeTrait, TypeTrait; -class GenInternalTypeTrait - : GenInternalTrait, TypeTrait; -class PredTypeTrait - : PredTrait, TypeTrait; + : ParamNativeTrait; +class GenInternalTypeTrait : GenInternalTrait; +class PredTypeTrait : PredTrait; //===----------------------------------------------------------------------===// // AttrTrait definitions //===----------------------------------------------------------------------===// -// AttrTrait represents a trait regarding an attribute. -// TODO: Remove this class in favor of using Trait. -class AttrTrait; - // These classes are used to define attribute specific traits. -class NativeAttrTrait : NativeTrait, AttrTrait; +class NativeAttrTrait : NativeTrait; class ParamNativeAttrTrait - : ParamNativeTrait, AttrTrait; -class GenInternalAttrTrait - : GenInternalTrait, AttrTrait; -class PredAttrTrait - : PredTrait, AttrTrait; + : ParamNativeTrait; +class GenInternalAttrTrait : GenInternalTrait; +class PredAttrTrait : PredTrait; //===----------------------------------------------------------------------===// // OpTrait definitions //===----------------------------------------------------------------------===// -// OpTrait represents a trait regarding an operation. -// TODO: Remove this class in favor of using Trait. -class OpTrait; - -// Define a OpTrait corresponding to a list of OpTraits, this allows for -// specifying a list of traits as trait. Avoids needing to do -// `[Traits, ...] # ListOfTraits # [Others, ...]` while still allowing providing -// convenient groupings. -class OpTraitList props> : OpTrait { - list traits = props; +// Define a Trait corresponding to a list of Traits, this allows for specifying +// a list of traits as trait. Avoids needing to do `[Traits, ...] # ListOfTraits +// # [Others, ...]` while still allowing providing convenient groupings. +class OpTraitList props> : Trait { + list traits = props; } // These classes are used to define operation specific traits. -class NativeOpTrait : NativeTrait, OpTrait; +class NativeOpTrait : NativeTrait; class ParamNativeOpTrait - : ParamNativeTrait, OpTrait; -class GenInternalOpTrait : GenInternalTrait, OpTrait; -class PredOpTrait : PredTrait, OpTrait; + : ParamNativeTrait; +class GenInternalOpTrait : GenInternalTrait; +class PredOpTrait : PredTrait; // Op defines an affine scope. def AffineScope : NativeOpTrait<"AffineScope">; @@ -2094,7 +2077,7 @@ // Group together `Elementwise`, `Scalarizable`, `Vectorizable`, and // `Tensorizable` for convenience. def ElementwiseMappable { - list traits = [ + list traits = [ Elementwise, Scalarizable, Vectorizable, @@ -2184,7 +2167,7 @@ // C++. The purpose to wrap around C++ symbol string with this class is to make // interfaces specified for ops in TableGen less alien and more integrated. class OpInterfaceTrait - : InterfaceTrait, OpTrait { + : InterfaceTrait { // Specify the body of the verification function. `$_op` will be replaced with // the operation being verified. code verify = verifyBody; @@ -2376,7 +2359,7 @@ : OpVariable; // Base class for all ops. -class Op props = []> { +class Op props = []> { // The dialect of the op. Dialect opDialect = dialect; @@ -2460,7 +2443,7 @@ // Op traits. // Note: The list of traits will be uniqued by ODS. - list traits = props; + list traits = props; // Additional code that will be added to the public part of the generated // C++ code of the op declaration. @@ -2475,7 +2458,7 @@ // Base class for ops with static/dynamic offset, sizes and strides // attributes/arguments. class BaseOpWithOffsetSizesAndStrides traits = []> : + list traits = []> : Op { // For every such op, there needs to be a: diff --git a/mlir/include/mlir/IR/RegionKindInterface.td b/mlir/include/mlir/IR/RegionKindInterface.td --- a/mlir/include/mlir/IR/RegionKindInterface.td +++ b/mlir/include/mlir/IR/RegionKindInterface.td @@ -55,7 +55,7 @@ // Op's regions that don't need a terminator: requires some other traits // so it defines a list that must be concatenated. def GraphRegionNoTerminator { - list traits = [ + list traits = [ NoTerminator, SingleBlock, RegionKindInterface, diff --git a/mlir/test/lib/Dialect/Test/TestOps.td b/mlir/test/lib/Dialect/Test/TestOps.td --- a/mlir/test/lib/Dialect/Test/TestOps.td +++ b/mlir/test/lib/Dialect/Test/TestOps.td @@ -32,7 +32,7 @@ include "TestTypeDefs.td" -class TEST_Op traits = []> : +class TEST_Op traits = []> : Op; //===----------------------------------------------------------------------===// @@ -2160,7 +2160,7 @@ // Base class for testing mixing allOperandTypes, allOperands, and // inferResultTypes. -class FormatInferAllTypesBaseOp traits = []> +class FormatInferAllTypesBaseOp traits = []> : TEST_Op { let arguments = (ins Variadic:$args); let results = (outs Variadic:$outs); @@ -2292,7 +2292,7 @@ ]; } -class BufferBasedOpBase traits> +class BufferBasedOpBase traits> : TEST_Op { let description = [{ A buffer based operation, that uses memRefs as input and output. @@ -2424,7 +2424,7 @@ // Base class for testing `build` methods for ops with // InferReturnTypeOpInterface. class TableGenBuildInferReturnTypeBaseOp traits = []> + list traits = []> : TEST_Op { let arguments = (ins Variadic:$inputs); let results = (outs AnyType:$result); diff --git a/mlir/test/mlir-tblgen/constraint-unique.td b/mlir/test/mlir-tblgen/constraint-unique.td --- a/mlir/test/mlir-tblgen/constraint-unique.td +++ b/mlir/test/mlir-tblgen/constraint-unique.td @@ -6,7 +6,7 @@ let name = "test"; } -class NS_Op traits = []> : +class NS_Op traits = []> : Op; /// Test unique'ing of type, attribute, successor, and region constraints. diff --git a/mlir/test/mlir-tblgen/op-attribute.td b/mlir/test/mlir-tblgen/op-attribute.td --- a/mlir/test/mlir-tblgen/op-attribute.td +++ b/mlir/test/mlir-tblgen/op-attribute.td @@ -8,7 +8,7 @@ let name = "test"; let cppNamespace = "foobar"; } -class NS_Op traits> : +class NS_Op traits> : Op; def SomeAttr : Attr, "some attribute kind"> { diff --git a/mlir/test/mlir-tblgen/op-decl-and-defs.td b/mlir/test/mlir-tblgen/op-decl-and-defs.td --- a/mlir/test/mlir-tblgen/op-decl-and-defs.td +++ b/mlir/test/mlir-tblgen/op-decl-and-defs.td @@ -13,7 +13,7 @@ let cppNamespace = "NS"; let emitAccessorPrefix = kEmitAccessorPrefix_Prefixed; } -class NS_Op traits> : +class NS_Op traits> : Op; // IsolatedFromAbove trait is included twice to ensure it gets uniqued during diff --git a/mlir/test/mlir-tblgen/op-format-spec.td b/mlir/test/mlir-tblgen/op-format-spec.td --- a/mlir/test/mlir-tblgen/op-format-spec.td +++ b/mlir/test/mlir-tblgen/op-format-spec.td @@ -8,7 +8,7 @@ def TestDialect : Dialect { let name = "test"; } -class TestFormat_Op traits = []> +class TestFormat_Op traits = []> : Op { let assemblyFormat = fmt; } diff --git a/mlir/test/mlir-tblgen/op-operand.td b/mlir/test/mlir-tblgen/op-operand.td --- a/mlir/test/mlir-tblgen/op-operand.td +++ b/mlir/test/mlir-tblgen/op-operand.td @@ -5,7 +5,7 @@ def Test_Dialect : Dialect { let name = "test"; } -class NS_Op traits> : +class NS_Op traits> : Op; def OpA : NS_Op<"one_normal_operand_op", []> { diff --git a/mlir/test/mlir-tblgen/op-python-bindings.td b/mlir/test/mlir-tblgen/op-python-bindings.td --- a/mlir/test/mlir-tblgen/op-python-bindings.td +++ b/mlir/test/mlir-tblgen/op-python-bindings.td @@ -12,7 +12,7 @@ let name = "test"; let cppNamespace = "Test"; } -class TestOp traits = []> : +class TestOp traits = []> : Op; // CHECK: @_ods_cext.register_operation(_Dialect) diff --git a/mlir/test/mlir-tblgen/op-result.td b/mlir/test/mlir-tblgen/op-result.td --- a/mlir/test/mlir-tblgen/op-result.td +++ b/mlir/test/mlir-tblgen/op-result.td @@ -6,7 +6,7 @@ def Test_Dialect : Dialect { let name = "test"; } -class NS_Op traits> : +class NS_Op traits> : Op; def OpA : NS_Op<"one_normal_result_op", []> { diff --git a/mlir/test/mlir-tblgen/op-side-effects.td b/mlir/test/mlir-tblgen/op-side-effects.td --- a/mlir/test/mlir-tblgen/op-side-effects.td +++ b/mlir/test/mlir-tblgen/op-side-effects.td @@ -5,7 +5,7 @@ def TEST_Dialect : Dialect { let name = "test"; } -class TEST_Op traits = []> : +class TEST_Op traits = []> : Op; def CustomResource : Resource<"CustomResource">; diff --git a/mlir/test/mlir-tblgen/predicate.td b/mlir/test/mlir-tblgen/predicate.td --- a/mlir/test/mlir-tblgen/predicate.td +++ b/mlir/test/mlir-tblgen/predicate.td @@ -5,7 +5,7 @@ def Test_Dialect : Dialect { let name = "test"; } -class NS_Op traits> : +class NS_Op traits> : Op; def I32OrF32 : Type, diff --git a/mlir/test/mlir-tblgen/rewriter-errors.td b/mlir/test/mlir-tblgen/rewriter-errors.td --- a/mlir/test/mlir-tblgen/rewriter-errors.td +++ b/mlir/test/mlir-tblgen/rewriter-errors.td @@ -11,7 +11,7 @@ let name = "a"; } -class A_Op traits = []> : +class A_Op traits = []> : Op; def OpA : A_Op<"op_a">, Arguments<(ins AnyInteger, AnyInteger)>, Results<(outs AnyInteger)>; diff --git a/mlir/test/mlir-tblgen/rewriter-indexing.td b/mlir/test/mlir-tblgen/rewriter-indexing.td --- a/mlir/test/mlir-tblgen/rewriter-indexing.td +++ b/mlir/test/mlir-tblgen/rewriter-indexing.td @@ -5,7 +5,7 @@ def Test_Dialect : Dialect { let name = "test"; } -class NS_Op traits> : +class NS_Op traits> : Op; def AOp : NS_Op<"a_op", []> { diff --git a/mlir/test/mlir-tblgen/rewriter-static-matcher.td b/mlir/test/mlir-tblgen/rewriter-static-matcher.td --- a/mlir/test/mlir-tblgen/rewriter-static-matcher.td +++ b/mlir/test/mlir-tblgen/rewriter-static-matcher.td @@ -5,7 +5,7 @@ def Test_Dialect : Dialect { let name = "test"; } -class NS_Op traits> : +class NS_Op traits> : Op; def AOp : NS_Op<"a_op", []> { diff --git a/mlir/test/python/python_test_ops.td b/mlir/test/python/python_test_ops.td --- a/mlir/test/python/python_test_ops.td +++ b/mlir/test/python/python_test_ops.td @@ -28,7 +28,7 @@ let mnemonic = attrMnemonic; } -class TestOp traits = []> +class TestOp traits = []> : Op; //===----------------------------------------------------------------------===//