|
GTPin
|
Register allocation interface. More...
#include <igt_reg_allocator.h>
Public Member Functions | |
| virtual bool | Reserve (GtVregNum vn)=0 |
| Assign an available physical register (preg) to the specified virtual register (vreg) | |
| virtual bool | ReserveAll ()=0 |
| Assign physical registers to all currently defined virtual registers that are not yet assigned. | |
| virtual const GtReg * | GetReserved (GtVregNum vn) const =0 |
| Get physical register assigned to the specified virtual register. | |
| virtual void | ReleaseReserved (GtVregNum vn)=0 |
| Remove assignment of a physical register to the specified virtual register, if any. | |
| virtual void | ReleaseAllReserved ()=0 |
| Remove all physical-to-virtual register assignments. | |
| virtual bool | ReserveVregOperands (const IGtGenProcedure &proc)=0 |
| Assign physical registers to all virtual registers used in the specified procedure. | |
Register allocation interface.
Normally, GTPin allocates registers when the tool finishes instrumentation of the original code. This process is triggered automatically, without any tool's guidance.
The register allocation algorithm analyses register liveness in each instrumentation point, so that the same virtual register can be assigned to different physical registers in different points. However, if needed, the tool can use the IGtRegAllocator interface to allocate physical register (preg) for a virtual register (vreg) globally, so that the same preg will represent vreg in all instrumentation procedures.
Note, such global assignments restrict flexibility of the register allocator in GTPin, so, in general, using the instrumentation-time register allocation is discouraged. It is only recommended for tools, that need to enforce minimal overhead of a specific instrumentation procedure.
| virtual const GtReg* gtpin::IGtRegAllocator::GetReserved | ( | GtVregNum | vn | ) | const [pure virtual] |
Get physical register assigned to the specified virtual register.
| [in] | vn | Identifier of the virtual register being queried |
| virtual void gtpin::IGtRegAllocator::ReleaseReserved | ( | GtVregNum | vn | ) | [pure virtual] |
Remove assignment of a physical register to the specified virtual register, if any.
| [in] | vn | Identifier of the virtual register to be released |
| virtual bool gtpin::IGtRegAllocator::Reserve | ( | GtVregNum | vn | ) | [pure virtual] |
Assign an available physical register (preg) to the specified virtual register (vreg)
The assignment is global: preg will represent vreg in all instrumentation procedures.
| [in] | vn | Identifier of the virtual register to be assigned |
| virtual bool gtpin::IGtRegAllocator::ReserveAll | ( | ) | [pure virtual] |
Assign physical registers to all currently defined virtual registers that are not yet assigned.
The assignments are global: each vreg will be represented by the same preg in all instrumentation procedures.
| virtual bool gtpin::IGtRegAllocator::ReserveVregOperands | ( | const IGtGenProcedure & | proc | ) | [pure virtual] |
Assign physical registers to all virtual registers used in the specified procedure.
| [in] | proc | Procedure in which vregs should be allocated |
Copyright (C) 2013-2025 Intel Corporation
SPDX-License-Identifier: MIT
1.7.4