mlir.dialects.irdl¶
Attributes¶
Classes¶
The |
|
|
|
|
|
|
Functions¶
|
|
|
|
|
|
|
|
|
Module Contents¶
- mlir.dialects.irdl._ods_ir¶
- class mlir.dialects.irdl.DialectOp(sym_name: str | _ods_ir, *, loc=None, ip=None)¶
Bases:
DialectOpThe
irdl.dialectoperation defines a dialect. All operations, attributes, and types defined inside its region will be part of the dialect.Example:
irdl.dialect @cmath { ... }
The above program defines a
cmathdialect.- __doc__¶
- property body: _ods_ir¶
- class mlir.dialects.irdl.OperationOp(sym_name: str | _ods_ir, *, loc=None, ip=None)¶
Bases:
OperationOpirdl.operationdefines a new operation belonging to theirdl.dialectparent.Operations can define constraints on their operands and results with the
irdl.resultsandirdl.operandsoperations. If these operations are not present in the region, the results or operands are expected to be empty.Example:
irdl.dialect @cmath { irdl.type @complex { /* ... */ } irdl.operation @norm { %0 = irdl.any %1 = irdl.parametric @cmath::@complex<%0> irdl.results(%0) irdl.operands(%1) } }
The above program defines an operation
norminside the dialectcmath. The operation expects a single operand of base typecmath.complex, and returns a single result of the element type of the operand.- __doc__¶
- property body: _ods_ir¶
- mlir.dialects.irdl.operation_(sym_name: str | _ods_ir, *, loc=None, ip=None) OperationOp¶
- class mlir.dialects.irdl.TypeOp(sym_name: str | _ods_ir, *, loc=None, ip=None)¶
Bases:
TypeOpirdl.typedefines a new type belonging to theirdl.dialectparent.The type parameters can be defined with an
irdl.parametersoperation in the optional region.Example:
irdl.dialect @cmath { irdl.type @complex { %0 = irdl.is i32 %1 = irdl.is i64 %2 = irdl.any_of(%0, %1) irdl.parameters(%2) } }
The above program defines a type
complexinside the dialectcmath. The type has a single parameter that should be eitheri32ori64.- __doc__¶
- property body: _ods_ir¶
- class mlir.dialects.irdl.AttributeOp(sym_name: str | _ods_ir, *, loc=None, ip=None)¶
Bases:
AttributeOpirdl.attributedefines a new attribute belonging to theirdl.dialectparent.The attribute parameters can be defined with an
irdl.parametersoperation in the optional region.Example:
irdl.dialect @testd { irdl.attribute @enum_attr { %0 = irdl.is "foo" %1 = irdl.is "bar" %2 = irdl.any_of(%0, %1) irdl.parameters(%2) } }
The above program defines an
enum_attrattribute inside thetestddialect. The attribute has oneStringAttrparameter that should be either a"foo"or a"bar".- __doc__¶
- property body: _ods_ir¶
- mlir.dialects.irdl.attribute(sym_name: str | _ods_ir, *, loc=None, ip=None) AttributeOp¶
- mlir.dialects.irdl._variadicity_array_attr(x: Sequence[mlir.dialects._irdl_enum_gen.Variadicity], context) _ods_ir¶