Op selector
op_selector
¶
OpSelector
¶
Bases: NamedTuple
A specifier of an operation in a module. Useful when a stable reference is needed across copies of a module.
Source code in xdsl/utils/op_selector.py
idx: int
instance-attribute
¶
The index of the operation in a module, when walking top to bottom as printed in the IR.
op_name: str
instance-attribute
¶
The name of the expected operation, used to check that the op found is the expected one.
get_op(module_op: ModuleOp)
¶
Returns the matching op, raising IndexError if the index is out of bounds and ValueError if the name does not match.