C# Class Reko.Analysis.ValueNumbering

This class is used to compute value numbers of all the SSA variables of a procedure. As a useful side effect, it also detects induction variables, determines their stride &c. This will be useful later when we need to classify arrays.
Afficher le fichier Open project: uxmal/reko Class Usage Examples

Private Properties

Свойство Type Description
AddNodeInOrder void
AssignValueNumber bool
ClassifyInductionVariable void
DFS Node
ProcessScc void

Méthodes publiques

Méthode Description
AssignInitialValueNumbers ( ) : void
Dump ( ) : void
GetDefiningExpression ( Identifier id ) : Expression
GetValueNumber ( Identifier id ) : Expression
Lookup ( Expression expr, Expression>.Dictionary table, Expression lvalue ) : Expression

Looks up the value number of an expression. If it can't be found in the table, the SSA name lvalue is used as a value number. in the table.

ValueNumbering ( SsaIdentifierCollection ssaIds ) : Reko.Core
Write ( System.IO.TextWriter writer ) : void

Private Methods

Méthode Description
AddNodeInOrder ( List al, Node n ) : void
AssignValueNumber ( Node n, Expression>.Dictionary table ) : bool

Assigns a value number to the variable identified by the node 'n'. If the node changes value, we return true.

ClassifyInductionVariable ( List scc ) : void
DFS ( Identifier id ) : Node
ProcessScc ( List scc ) : void

Process a strongly connected component of identifiers and phi- functions. A singleton is easy, we just give it a value number. Loops have to be iterated until they stabilize.

Method Details

AssignInitialValueNumbers() public méthode

public AssignInitialValueNumbers ( ) : void
Résultat void

Dump() public méthode

public Dump ( ) : void
Résultat void

GetDefiningExpression() public méthode

public GetDefiningExpression ( Identifier id ) : Expression
id Identifier
Résultat Expression

GetValueNumber() public méthode

public GetValueNumber ( Identifier id ) : Expression
id Identifier
Résultat Expression

Lookup() public méthode

Looks up the value number of an expression. If it can't be found in the table, the SSA name lvalue is used as a value number. in the table.
public Lookup ( Expression expr, Expression>.Dictionary table, Expression lvalue ) : Expression
expr Expression Expression to look for
table Expression>.Dictionary
lvalue Expression
Résultat Expression

ValueNumbering() public méthode

public ValueNumbering ( SsaIdentifierCollection ssaIds ) : Reko.Core
ssaIds SsaIdentifierCollection
Résultat Reko.Core

Write() public méthode

public Write ( System.IO.TextWriter writer ) : void
writer System.IO.TextWriter
Résultat void