asmjit::VirtReg Class Reference [¶]
Public virtual register interface, managed by BaseCompiler.
When a virtual register is created by BaseCompiler a VirtReg
is linked with the register operand id it returns. This VirtReg
can be accessed via BaseCompiler::virt_reg_by_reg() function, which returns a pointer to VirtReg
.
In general, VirtReg
should be only introspected as it contains important variables that are needed and managed by AsmJit, however, the VirtReg
API can also be used to influence register allocation. For example there is a VirtReg::set_weight() function, which could be used to increase a weight of a virtual register (thus make it hard to spill, for example). In addition, there is a VirtReg::set_home_id_hint() function, which can be used to do an initial assignment of a physical register of a virtual register. However, AsmJit could still override the physical register assigned in some special cases.