ILGPU  0.9.0
ILGPU.Backends.RegisterAllocator< TKind > Class Template Referenceabstract

Represents a generic register allocator. More...

Classes

class  CompoundRegister
 Represents a compound register of a complex type. More...
 
class  ConstantRegister
 A primitive register with a constant value. More...
 
class  HardwareRegister
 Represents a primitive register that represents an actual hardware register. More...
 
class  PrimitiveRegister
 Represents a primitive register that might consume up to one hardware register. More...
 
class  Register
 Represents an abstract register More...
 
struct  RegisterDescription
 Describes allocation information of a single primitive register. More...
 

Public Member Functions

abstract HardwareRegister AllocateRegister (RegisterDescription description)
 Allocates a new hardware register of the given kind. More...
 
abstract void FreeRegister (HardwareRegister hardwareRegister)
 Frees the given register. More...
 
HardwareRegister Allocate (Value node, RegisterDescription description)
 Allocates a specific register kind for the given node. More...
 
HardwareRegister AllocateHardware (Value node)
 Allocates a specific register kind for the given node. More...
 
Register Allocate (Value node)
 Allocates a specific register kind for the given node. More...
 
void Bind (Value node, Register targetRegister)
 Binds the given value to the target register. More...
 
Register AllocateType (TypeNode typeNode)
 Allocates a new register recursively More...
 
void Alias (Value node, Value aliasNode)
 Registers a register alias. More...
 
LoadAs< T > (Value node)
 Loads the allocated register of the given node. More...
 
Register Load (Value node)
 Loads the allocated register of the given node. More...
 
PrimitiveRegister LoadPrimitive (Value node)
 Loads the allocated primitive register of the given node. More...
 
HardwareRegister LoadHardware (Value node)
 Loads the allocated primitive register of the given node. More...
 
void Free (Value node)
 Frees the given node. More...
 

Protected Member Functions

 RegisterAllocator (Backend backend)
 Constructs a new register allocator. More...
 
abstract RegisterDescription ResolveRegisterDescription (TypeNode type)
 Resolves a register description for the given type. More...
 

Properties

Backend Backend [get]
 Returns the underlying ABI. More...
 

Detailed Description

Represents a generic register allocator.

Template Parameters
TKindThe register kind.

The members of this class are not thread safe.

Type Constraints
TKind :struct 

Constructor & Destructor Documentation

Constructs a new register allocator.

Parameters
backendThe underlying backend.

Member Function Documentation

void ILGPU.Backends.RegisterAllocator< TKind >.Alias ( Value  node,
Value  aliasNode 
)

Registers a register alias.

Parameters
nodeThe node.
aliasNodeThe alias node.
HardwareRegister ILGPU.Backends.RegisterAllocator< TKind >.Allocate ( Value  node,
RegisterDescription  description 
)

Allocates a specific register kind for the given node.

Parameters
nodeThe node to allocate the register for.
descriptionThe register description to allocate.
Returns
The allocated register.
Register ILGPU.Backends.RegisterAllocator< TKind >.Allocate ( Value  node)

Allocates a specific register kind for the given node.

Parameters
nodeThe node to allocate the register for.
Returns
The allocated register.
HardwareRegister ILGPU.Backends.RegisterAllocator< TKind >.AllocateHardware ( Value  node)

Allocates a specific register kind for the given node.

Parameters
nodeThe node to allocate the register for.
Returns
The allocated register.
abstract HardwareRegister ILGPU.Backends.RegisterAllocator< TKind >.AllocateRegister ( RegisterDescription  description)
pure virtual

Allocates a new hardware register of the given kind.

Parameters
descriptionThe register description used for allocation.
Returns
The allocated register.

Implemented in ILGPU.Backends.PTX.PTXRegisterAllocator.

Register ILGPU.Backends.RegisterAllocator< TKind >.AllocateType ( TypeNode  typeNode)

Allocates a new register recursively

Parameters
typeNodeThe node type to allocate.
void ILGPU.Backends.RegisterAllocator< TKind >.Bind ( Value  node,
Register  targetRegister 
)

Binds the given value to the target register.

Parameters
nodeThe node to bind.
targetRegisterThe target register to bind to.
void ILGPU.Backends.RegisterAllocator< TKind >.Free ( Value  node)

Frees the given node.

Parameters
nodeThe node to free.
abstract void ILGPU.Backends.RegisterAllocator< TKind >.FreeRegister ( HardwareRegister  hardwareRegister)
pure virtual

Frees the given register.

Parameters
hardwareRegisterThe register to free.

Implemented in ILGPU.Backends.PTX.PTXRegisterAllocator.

Loads the allocated register of the given node.

Parameters
nodeThe node.
Returns
The allocated register.
T ILGPU.Backends.RegisterAllocator< TKind >.LoadAs< T > ( Value  node)

Loads the allocated register of the given node.

Parameters
nodeThe node.
Returns
The allocated register.
Type Constraints
T :Register 
HardwareRegister ILGPU.Backends.RegisterAllocator< TKind >.LoadHardware ( Value  node)

Loads the allocated primitive register of the given node.

Parameters
nodeThe node.
Returns
The allocated register.
PrimitiveRegister ILGPU.Backends.RegisterAllocator< TKind >.LoadPrimitive ( Value  node)

Loads the allocated primitive register of the given node.

Parameters
nodeThe node.
Returns
The allocated register.
abstract RegisterDescription ILGPU.Backends.RegisterAllocator< TKind >.ResolveRegisterDescription ( TypeNode  type)
protectedpure virtual

Resolves a register description for the given type.

Parameters
typeThe type to convert to.
Returns
The resolved register description.

Property Documentation

Returns the underlying ABI.


The documentation for this class was generated from the following file: