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.
显示文件 Open project: uxmal/reko Class Usage Examples

Private Properties

Property Type Description
AddNodeInOrder void
AssignValueNumber bool
ClassifyInductionVariable void
DFS Node
ProcessScc void

Public Methods

Method 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

Method 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 method

public AssignInitialValueNumbers ( ) : void
return void

Dump() public method

public Dump ( ) : void
return void

GetDefiningExpression() public method

public GetDefiningExpression ( Identifier id ) : Expression
id Identifier
return Expression

GetValueNumber() public method

public GetValueNumber ( Identifier id ) : Expression
id Identifier
return Expression

Lookup() public method

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
return Expression

ValueNumbering() public method

public ValueNumbering ( SsaIdentifierCollection ssaIds ) : Reko.Core
ssaIds SsaIdentifierCollection
return Reko.Core

Write() public method

public Write ( System.IO.TextWriter writer ) : void
writer System.IO.TextWriter
return void