Changeset View
Changeset View
Standalone View
Standalone View
mlir/include/mlir/IR/OpBase.td
Show First 20 Lines • Show All 1,652 Lines • ▼ Show 20 Lines | |||||
def SameOperandsAndResultShape : NativeOpTrait<"SameOperandsAndResultShape">; | def SameOperandsAndResultShape : NativeOpTrait<"SameOperandsAndResultShape">; | ||||
// Op has the same operand and result type. | // Op has the same operand and result type. | ||||
def SameOperandsAndResultType : NativeOpTrait<"SameOperandsAndResultType">; | def SameOperandsAndResultType : NativeOpTrait<"SameOperandsAndResultType">; | ||||
// Op has the same element type (or type itself, if scalar) for all operands. | // Op has the same element type (or type itself, if scalar) for all operands. | ||||
def SameOperandsElementType : NativeOpTrait<"SameOperandsElementType">; | def SameOperandsElementType : NativeOpTrait<"SameOperandsElementType">; | ||||
// Op has the same operand and result element type (or type itself, if scalar). | // Op has the same operand and result element type (or type itself, if scalar). | ||||
def SameOperandsAndResultElementType : | def SameOperandsAndResultElementType : | ||||
NativeOpTrait<"SameOperandsAndResultElementType">; | NativeOpTrait<"SameOperandsAndResultElementType">; | ||||
// Op is a symbol. | |||||
def Symbol : NativeOpTrait<"Symbol">; | |||||
// Op defines a symbol table. | |||||
def SymbolTable : NativeOpTrait<"SymbolTable">; | |||||
// Op is a terminator. | // Op is a terminator. | ||||
def Terminator : NativeOpTrait<"IsTerminator">; | def Terminator : NativeOpTrait<"IsTerminator">; | ||||
// Op's regions have a single block with the specified terminator. | // Op's regions have a single block with the specified terminator. | ||||
class SingleBlockImplicitTerminator<string op> | class SingleBlockImplicitTerminator<string op> | ||||
: ParamNativeOpTrait<"SingleBlockImplicitTerminator", op>; | : ParamNativeOpTrait<"SingleBlockImplicitTerminator", op>; | ||||
// Op's parent operation is the provided one. | // Op's parent operation is the provided one. | ||||
▲ Show 20 Lines • Show All 43 Lines • ▼ Show 20 Lines | |||||
// C++. The purpose to wrap around C++ symbol string with this class is to make | // 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. | // interfaces specified for ops in TableGen less alien and more integrated. | ||||
class OpInterfaceTrait<string name, code verifyBody = [{}]> : NativeOpTrait<""> { | class OpInterfaceTrait<string name, code verifyBody = [{}]> : NativeOpTrait<""> { | ||||
let trait = name # "::Trait"; | let trait = name # "::Trait"; | ||||
// Specify the body of the verification function. `$_op` will be replaced with | // Specify the body of the verification function. `$_op` will be replaced with | ||||
// the operation being verified. | // the operation being verified. | ||||
code verify = verifyBody; | code verify = verifyBody; | ||||
// An optional code block containing extra declarations to place in the | |||||
// interface trait declaration. | |||||
code extraTraitClassDeclaration = ""; | |||||
} | } | ||||
// This class represents a single, optionally static, interface method. | // This class represents a single, optionally static, interface method. | ||||
// Note: non-static interface methods have an implicit 'op' parameter | // Note: non-static interface methods have an implicit 'op' parameter | ||||
// corresponding to an instance of the derived operation. | // corresponding to an instance of the derived operation. | ||||
class InterfaceMethod<string desc, string retTy, string methodName, | class InterfaceMethod<string desc, string retTy, string methodName, | ||||
dag args = (ins), code methodBody = [{}], | dag args = (ins), code methodBody = [{}], | ||||
code defaultImplementation = [{}]> { | code defaultImplementation = [{}]> { | ||||
▲ Show 20 Lines • Show All 507 Lines • Show Last 20 Lines |