Register allocation
register_allocation
¶
RegisterAllocatorLivenessBlockNaive
¶
Bases: BlockNaiveAllocator
Source code in xdsl/backend/riscv/register_allocation.py
__init__(available_registers: RegisterStack) -> None
¶
new_type_for_value(reg: SSAValue) -> RegisterType | None
¶
Source code in xdsl/backend/riscv/register_allocation.py
allocate_func(func: riscv_func.FuncOp, *, add_regalloc_stats: bool = False) -> None
¶
Allocates values in function passed in to registers.
The whole function must have been lowered to the relevant riscv dialects
and it must contain no unrealized casts.
If add_regalloc_stats is set to True, then a comment op will be inserted
before the function op passed in with a json containing the relevant data.
Source code in xdsl/backend/riscv/register_allocation.py
reg_types_by_name(regs: Iterable[RegisterType]) -> dict[str, set[str]]
¶
Groups register types by name.