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
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
iter_excluded_registers() -> Iterator[RegisterType]
¶
allocate_registers(allocator: BlockAllocator) -> None
abstractmethod
¶
update_liveness(ctx: LivenessContext) -> None
abstractmethod
¶
all_used_registers(region: Region) -> AbstractSet[RegisterType]
staticmethod
¶
All used registers of all operations within a region.
Source code in xdsl/backend/register_allocatable.py
all_excluded_registers(region: Region) -> AbstractSet[RegisterType]
staticmethod
¶
All excluded registers as declared by all operations within a region.
Source code in xdsl/backend/register_allocatable.py
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
HasRegisterConstraintsTrait
dataclass
¶
Bases: OpTrait
Trait that verifies that the operation implements HasRegisterConstraints, and that
its constraints account for each operand and result as many times as it occurs.
An operand is declared by ins or inouts, a result by outs or inouts. A value
occupying several operands is declared once per operand, so an operation may read a
value as an in register and also clobber it as an inout register.
Source code in xdsl/backend/register_allocatable.py
verify(op: Operation) -> None
¶
Source code in xdsl/backend/register_allocatable.py
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. see pass x86-regalloc-verify-liveness).
Source code in xdsl/backend/register_allocatable.py
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.