GTPin: gtpin::IGtVregFactory Class Reference

GTPin

- Main Page
- Related Pages
- Modules
- Data Structures

- Data Structures
- Data Structure Index
- Class Hierarchy
- Data Fields

Public Member Functions
gtpin::IGtVregFactory Class Reference
Register Allocation

Factory and container of virtual registers. More...

`#include <igt_vreg_factory.h>`

## Public Member Functions
virtual const IGtVreg & | Make (GtVregType type=VREG_TYPE_DWORD, uint32_t flags=VREG_FLAG_NONE, GtSubRegNum subRegNum=GtSubRegNum::Invalid())=0
| Create a new virtual register with the specified properties and store it in the factory's container.
virtual const IGtVreg & | Get (GtVregNum vn) const =0
| Get virtual register with the specified ordinal number.
virtual const IGtVreg & | GetProfileBufferAddrVreg () const =0
| Get a special virtual register intended to hold address of the profile buffer in GPU.
virtual bool | Contains (GtVregNum vn) const =0
| Check to see if a virtual register with the specified ordinal number exists.
virtual uint32_t | Size () const =0
| Return number of virtual registers in this container.
virtual void | Clear ()=0
| Remove all virtual registers created by this factory.
virtual const IGtVreg & | MakeCounter (GtVregType type=VREG_TYPE_DWORD)=0
| Return Virtual register of the specified type, zero-initialized on entry to the kernel.
virtual const IGtVreg & | MakeScratch (GtVregType type=VREG_TYPE_DWORD)=0
| Return Scratch virtual register of the specified type.
virtual const IGtVreg & | MakeMsgAddrScratch (GtVregType type=VREG_TYPE_PTR)=0
| Return Scratch virtual register of the specified type, intended to hold a SEND message address payload.
virtual const IGtVreg & | MakeMsgDataScratch (GtVregType type=VREG_TYPE_DWORD)=0
| Return Scratch virtual register of the specified type, intended to hold a SEND message data payload.
virtual uint32_t | GetVregSize (GtVregType type) const =0
| Given vreg type, return the register size in bytes.

## Detailed Description

Factory and container of virtual registers.

Availability:
  - IGtTool::OnKernelBuild

## Member Function Documentation

virtual bool gtpin::IGtVregFactory::Contains | ( | GtVregNum | vn | ) | const`[pure virtual]`

Check to see if a virtual register with the specified ordinal number exists.

Parameters:

  [in] | vn | Ordinal number of the virtual register

Returns:
  true, if this container holds a virtual register with the specified ordinal number

virtual const IGtVreg& gtpin::IGtVregFactory::Get | ( | GtVregNum | vn | ) | const`[pure virtual]`

Get virtual register with the specified ordinal number.

Parameters:

  [in] | vn | Ordinal number of the virtual register

Precondition:
  Contains(vn)

Returns:
  The requested virtual register

virtual const IGtVreg& gtpin::IGtVregFactory::GetProfileBufferAddrVreg | ( |  | ) | const`[pure virtual]`

Get a special virtual register intended to hold address of the profile buffer in GPU.

The returned register could be invalid, if GPU platform of this factory does not use a register to hold pointer to the profile buffer. For example, some GPU platforms pass the buffer address in a binding table entry rather than in a GRF register.
GTPin initializes this register at entry to the kernel. It is assumed that instrumentation procedures do not modify the value of this register, and use it as a read-only virtual register.

virtual const IGtVreg& gtpin::IGtVregFactory::Make | ( | GtVregType | type = `VREG_TYPE_DWORD`,
|  | uint32_t | flags = `VREG_FLAG_NONE`,
|  | GtSubRegNum | subRegNum = `GtSubRegNum::Invalid()`
| ) |  | `[pure virtual]`

Create a new virtual register with the specified properties and store it in the factory's container.

Parameters:

  [in] | type | Type of the register.
  [in] | flags | Combination of VREG_FLAG values
  [in] | subRegNum | If valid, specifies required subregister number for this vreg. Invalid value means that this vreg has no restriction on physical subregister number assignment

Returns:
  Reference to the new virtual register

Precondition:
  Size of the virtual register, as implied by its type, should not exceed maximum size of physical registers in the GEN model, associated with the factory (see IGtGenModel::GrfRegSize()).

All Data Structures Functions Variables Typedefs Enumerations Enumerator

      Copyright (C) 2013-2025 Intel Corporation

      SPDX-License-Identifier: MIT