Ematch
ematch
¶
Ematch = Dialect('ematch', [GetClassValsOp, GetClassRepresentativeOp, GetClassResultOp, GetClassResultsOp, UnionOp, DedupOp, AreEquivalentOp])
module-attribute
¶
GetClassValsOp
¶
Bases: IRDLOperation
Take a value and return all values in its equivalence class.
If the value is an equivalence.class result, return the operands of the class, otherwise return a range containing the value itself.
Source code in xdsl/dialects/ematch.py
GetClassRepresentativeOp
¶
Bases: IRDLOperation
Get one of the values in the equivalence class of v.
Source code in xdsl/dialects/ematch.py
GetClassResultOp
¶
Bases: IRDLOperation
Get the equivalence.class result corresponding to the equivalence class of v.
Source code in xdsl/dialects/ematch.py
GetClassResultsOp
¶
Bases: IRDLOperation
Get the equivalence.class results corresponding to the equivalence classes of a range of values.
Source code in xdsl/dialects/ematch.py
name = 'ematch.get_class_results'
class-attribute
instance-attribute
¶
values = operand_def(RangeType[ValueType])
class-attribute
instance-attribute
¶
result = result_def(RangeType[ValueType])
class-attribute
instance-attribute
¶
assembly_format = '$values attr-dict'
class-attribute
instance-attribute
¶
UnionOp
¶
Bases: IRDLOperation
Merge two values, an operation and a value range, or two value ranges into equivalence class(es).
Supported operand type combinations:
- (value, value): merge two values
- (operation, range
Source code in xdsl/dialects/ematch.py
name = 'ematch.union'
class-attribute
instance-attribute
¶
lhs = operand_def(ValueType | OperationType | RangeType[ValueType])
class-attribute
instance-attribute
¶
rhs = operand_def(ValueType | RangeType[ValueType])
class-attribute
instance-attribute
¶
assembly_format = '$lhs `:` type($lhs) `,` $rhs `:` type($rhs) attr-dict'
class-attribute
instance-attribute
¶
DedupOp
¶
Bases: IRDLOperation
Check if the operation already exists in the hashcons.
If so, remove the new one and return the existing one.
Source code in xdsl/dialects/ematch.py
AreEquivalentOp
¶
Bases: IRDLOperation
Check whether two values are in the same equivalence class.
Unlike pdl_interp.are_equal, two equivalence.class results are considered
equivalent if their e-classes have been merged, even if they are not the
same SSA value. Values that are not equivalence.class results are only
equivalent to themselves. On success, control branches to the true
destination, otherwise to the false destination.