Register allocatable
register_allocatable
RegisterAllocatableOperation
dataclass
Bases: Operation, ABC
An abstract base class for operations that can be processed during register allocation.
Source code in xdsl/backend/register_allocatable.py
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 | |
iter_used_registers() -> Iterator[RegisterType]
The registers whose contents may be overwritten when executing this operation. By default returns the types of operands and results that are allocated registers.
Source code in xdsl/backend/register_allocatable.py
19 20 21 22 23 24 25 26 27 28 29 30 | |
allocate_registers(allocator: BlockAllocator) -> None
abstractmethod
Allocate registers for this operation.
Source code in xdsl/backend/register_allocatable.py
32 33 34 35 36 | |
iter_all_used_registers(region: Region) -> Iterator[RegisterType]
staticmethod
All used registers of all operations within a region.
Source code in xdsl/backend/register_allocatable.py
38 39 40 41 42 43 44 45 46 47 48 49 50 | |
RegisterConstraints
Bases: NamedTuple
Values used by an instruction.
A collection of operations in inouts represents the constraint that they must be
allocated to the same register.
Source code in xdsl/backend/register_allocatable.py
53 54 55 56 57 58 59 60 61 62 | |
ins: Sequence[SSAValue]
instance-attribute
outs: Sequence[SSAValue]
instance-attribute
inouts: Sequence[Sequence[SSAValue]]
instance-attribute
HasRegisterConstraintsTrait
dataclass
Bases: OpTrait
Trait that verifies that the operation implements HasRegisterConstraints, and that its inout operands are used only once. Using an inout operand more than once breaks SSA, as the register will hold an unexpected value after being mutated by this operation.
Source code in xdsl/backend/register_allocatable.py
65 66 67 68 69 70 71 72 73 74 75 76 77 | |
verify(op: Operation) -> None
Source code in xdsl/backend/register_allocatable.py
73 74 75 76 77 | |
HasRegisterConstraints
dataclass
Bases: RegisterAllocatableOperation, ABC
Abstract superclass for operations corresponding to assembly, with registers used as in, out, or inout registers. The use of a register value as inout must be its last use (externally verified, e.g. for x86 see pass verify-register-allocation).
Source code in xdsl/backend/register_allocatable.py
80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 | |
traits = traits_def(HasRegisterConstraintsTrait())
class-attribute
instance-attribute
get_register_constraints() -> RegisterConstraints
abstractmethod
The values with register types used by this operation, for use in register allocation.
Source code in xdsl/backend/register_allocatable.py
90 91 92 93 94 95 96 | |
allocate_registers(allocator: BlockAllocator) -> None
Source code in xdsl/backend/register_allocatable.py
98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 | |