Op inserter
op_inserter
¶
OpInserter
dataclass
¶
Class responsible for inserting operations at the right place in the generated IR.
Source code in xdsl/frontend/pyast/utils/op_inserter.py
insertion_point: Block
instance-attribute
¶
Insertion point, i.e. the pointer to the block to which the operations are appended.
stack: list[SSAValue] = field(default_factory=list[SSAValue])
class-attribute
instance-attribute
¶
Stack to hold the intermediate results of operations. For each new operation, its operands will be popped from the stack.
__init__(insertion_point: Block, stack: list[SSAValue] = list[SSAValue]()) -> None
¶
get_operand() -> SSAValue
¶
Pops the last value from the operand stack and returns it.
Source code in xdsl/frontend/pyast/utils/op_inserter.py
insert_op(op: Operation) -> None
¶
Inserts a new operation and places its results on the stack.
set_insertion_point_from_op(op: Operation) -> None
¶
Sets the insertion point to the last block in the last region of the operation.
Source code in xdsl/frontend/pyast/utils/op_inserter.py
set_insertion_point_from_region(region: Region) -> None
¶
Sets the insertion point to the last block in this region.