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
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 | |
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
26 27 28 29 30 31 32 33 34 | |
insert_op(op: Operation) -> None
Inserts a new operation and places its results on the stack.
Source code in xdsl/frontend/pyast/utils/op_inserter.py
36 37 38 39 40 | |
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
42 43 44 45 46 47 48 49 50 51 52 53 54 55 | |
set_insertion_point_from_region(region: Region) -> None
Sets the insertion point to the last block in this region.
Source code in xdsl/frontend/pyast/utils/op_inserter.py
57 58 59 60 61 62 63 | |
set_insertion_point_from_block(block: Block) -> None
Sets the insertion point to this block.
Source code in xdsl/frontend/pyast/utils/op_inserter.py
65 66 67 | |