ILGPU  0.9.0
ILGPU.IR.Analyses.PointerAlignments Class Reference

An analysis to determine safe alignment information for all pointer values. More...

Classes

struct  AlignmentInfo
 Stores alignment information of a specific method. More...
 

Public Member Functions

int GetAlignment (Value value, int safeMinAlignment)
 Returns safe alignment information. More...
 
int GetAlignment (Value value, TypeNode safeMinTypeAlignment)
 Returns safe alignment information. More...
 

Static Public Member Functions

static PointerAlignments Create (Method rootMethod, int globalAlignment)
 Creates a new alignment analysis. More...
 

Public Attributes

AlignmentInfo this[Method method]
 Returns pointer alignment information for the given method. More...
 
int this[Value value] => this[value.Method][value]
 Returns pointer alignment information for the given value. More...
 

Static Public Attributes

static readonly PointerAlignments Empty = new PointerAlignments()
 Represents no pointer alignment information. More...
 

Detailed Description

An analysis to determine safe alignment information for all pointer values.

Member Function Documentation

static PointerAlignments ILGPU.IR.Analyses.PointerAlignments.Create ( Method  rootMethod,
int  globalAlignment 
)
static

Creates a new alignment analysis.

Parameters
rootMethodThe root (entry) method.
globalAlignmentThe initial alignment information of all pointers and views of the entry method.
Returns
The created alignment analysis.
int ILGPU.IR.Analyses.PointerAlignments.GetAlignment ( Value  value,
int  safeMinAlignment 
)

Returns safe alignment information.

Parameters
valueThe value for which to compute the alignment for.
safeMinAlignmentThe safe minimum alignment in bytes.
Returns
The computed alignment.
int ILGPU.IR.Analyses.PointerAlignments.GetAlignment ( Value  value,
TypeNode  safeMinTypeAlignment 
)

Returns safe alignment information.

Parameters
valueThe value for which to compute the alignment for.
safeMinTypeAlignmentThe safe minimum type alignment.
Returns
The computed alignment.

Member Data Documentation

readonly PointerAlignments ILGPU.IR.Analyses.PointerAlignments.Empty = new PointerAlignments()
static

Represents no pointer alignment information.

AlignmentInfo ILGPU.IR.Analyses.PointerAlignments.this[Method method]
Initial value:
=>
alignments.TryGetValue(method, out var result)
? new AlignmentInfo(method, result)
: new AlignmentInfo(method, EmptyMapping)

Returns pointer alignment information for the given method.

Parameters
methodThe method to get alignment information for.
Returns
Resolved pointer alignment information.
int ILGPU.IR.Analyses.PointerAlignments.this[Value value] => this[value.Method][value]

Returns pointer alignment information for the given value.

Parameters
valueThe value to get alignment information for.
Returns
Pointer alignment in bytes (can be 1 byte).

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