ILGPU  0.9.0
ILGPU.IR.Construction.IRRebuilder Class Reference

Represents an IR rebuilder to rebuild parts of the IR. More...

Classes

struct  CloneMode
 The clone mode for rebuilding methods into a stub. More...
 
interface  IMode
 An abstract rebuilder mode. More...
 
struct  InlineMode
 The inlining mode for rebuilding a method into a set of new blocks. More...
 

Public Member Functions

bool TryGetNewNode (Value oldNode, out Value newNode)
 Tries to lookup the new node representation of the given old node. More...
 
void Map (Value oldNode, Value newNode)
 Maps the old node to the new node. More...
 
void ExportNodeMapping< TDictionary > (TDictionary target)
 Exports the internal node mapping to the given target dictionary. More...
 
Method LookupCallTarget (Method oldTarget)
 Resolves a method for the given old method More...
 
BasicBlock LookupTarget (BasicBlock oldTarget)
 Resolves a basic block builder for the given old block. More...
 
Value Rebuild (Value source)
 Rebuilds to given source node using lookup tables. More...
 
RebuildAs< T > (Value source)
 Rebuilds to given source node using lookup tables and returns the resolved casted to a specific type. More...
 

Static Public Member Functions

static IRRebuilder Create< TMode > (Method.Builder builder, Method.ParameterMapping parameterMapping, Method.MethodMapping methodRemapping, in BlockCollection blocks)
 Creates a new rebuilder. More...
 

Public Attributes

BasicBlock.Builder EntryBlock => blockMapping[Blocks.EntryBlock]
 Returns the target entry block. More...
 
BasicBlock. Builder
 Rebuilds all values. More...
 

Properties

Method.Builder Builder [get]
 Returns the associated method builder. More...
 
BlockCollection Blocks [get]
 Returns the associated collection. More...
 

Detailed Description

Represents an IR rebuilder to rebuild parts of the IR.

Member Function Documentation

static IRRebuilder ILGPU.IR.Construction.IRRebuilder.Create< TMode > ( Method.Builder  builder,
Method.ParameterMapping  parameterMapping,
Method.MethodMapping  methodRemapping,
in BlockCollection  blocks 
)
static

Creates a new rebuilder.

Template Parameters
TModeThe rebuilder mode.
Parameters
builderThe parent builder.
parameterMappingThe used parameter remapping.
methodRemappingThe used method remapping.
blocksThe block collection.
Returns
The created rebuilder.
Type Constraints
TMode :IMode 
void ILGPU.IR.Construction.IRRebuilder.ExportNodeMapping< TDictionary > ( TDictionary  target)

Exports the internal node mapping to the given target dictionary.

Template Parameters
TDictionaryThe dictionary type.
Parameters
targetThe target dictionary.
Type Constraints
TDictionary :IDictionary 
TDictionary :Value 
TDictionary :Value 
Method ILGPU.IR.Construction.IRRebuilder.LookupCallTarget ( Method  oldTarget)

Resolves a method for the given old method

Parameters
oldTargetThe old method.
Returns
The resolved method.
BasicBlock ILGPU.IR.Construction.IRRebuilder.LookupTarget ( BasicBlock  oldTarget)

Resolves a basic block builder for the given old block.

Parameters
oldTargetThe old basic block.
Returns
The resolved block builder.
void ILGPU.IR.Construction.IRRebuilder.Map ( Value  oldNode,
Value  newNode 
)

Maps the old node to the new node.

Parameters
oldNodeThe old node.
newNodeThe new node.
Value ILGPU.IR.Construction.IRRebuilder.Rebuild ( Value  source)

Rebuilds to given source node using lookup tables.

Parameters
sourceThe source node.
Returns
The new node.
T ILGPU.IR.Construction.IRRebuilder.RebuildAs< T > ( Value  source)

Rebuilds to given source node using lookup tables and returns the resolved casted to a specific type.

Template Parameters
TThe target type to cast the new node to.
Parameters
sourceThe source node.
Returns
The new node.
Type Constraints
T :Value 
T :Rebuild 
T :source 
T :as 
T :T 
bool ILGPU.IR.Construction.IRRebuilder.TryGetNewNode ( Value  oldNode,
out Value  newNode 
)

Tries to lookup the new node representation of the given old node.

Parameters
oldNodeThe old node.
newNodeThe new node.
Returns
True, if a corresponding new node could be found.

Member Data Documentation

BasicBlock. ILGPU.IR.Construction.IRRebuilder.Builder

Rebuilds all values.

Returns
The exit block and the associated return value.
BasicBlock.Builder ILGPU.IR.Construction.IRRebuilder.EntryBlock => blockMapping[Blocks.EntryBlock]

Returns the target entry block.

Property Documentation

BlockCollection ILGPU.IR.Construction.IRRebuilder.Blocks
get

Returns the associated collection.

Method.Builder ILGPU.IR.Construction.IRRebuilder.Builder
get

Returns the associated method builder.


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