Class ValueNumbering
A mapping of values to representative values for a particular control-flow graph.
Inheritance
Inherited Members
Namespace: Flame.Compiler.Analysis
Assembly: Flame.Compiler.dll
Syntax
public abstract class ValueNumbering
Methods
| Improve this Doc View SourceAreEquivalent(Instruction, Instruction)
Tests if two instructions are equivalent. Instructions 'a', 'b' are considered to be equivalent iff 'a' dominates 'b' implies that 'b' can be replaced with a copy of the result computed by 'a'.
Declaration
public virtual bool AreEquivalent(Instruction first, Instruction second)
Parameters
Type | Name | Description |
---|---|---|
Instruction | first | The first instruction to consider. |
Instruction | second | The second instruction to consider. |
Returns
Type | Description |
---|---|
System.Boolean |
|
AreEquivalent(Instruction, ValueTag)
Tests if an instruction is equivalent to a value.
Declaration
public bool AreEquivalent(Instruction first, ValueTag second)
Parameters
Type | Name | Description |
---|---|---|
Instruction | first | The instruction to consider. |
ValueTag | second | The value to consider. |
Returns
Type | Description |
---|---|
System.Boolean |
|
AreEquivalent(ValueTag, ValueTag)
Tests if two values are equivalent. Values 'a', 'b' are considered to be equivalent iff 'a' dominates 'b' implies that 'b' can be replaced with a copy of 'a'.
Declaration
public bool AreEquivalent(ValueTag first, ValueTag second)
Parameters
Type | Name | Description |
---|---|---|
ValueTag | first | The first value to consider. |
ValueTag | second | The second value to consider. |
Returns
Type | Description |
---|---|
System.Boolean |
|
GetNumber(ValueTag)
Gets a value's "number," i.e., another value that is representative of the set of all values that are equivalent with the value.
Declaration
public abstract ValueTag GetNumber(ValueTag value)
Parameters
Type | Name | Description |
---|---|---|
ValueTag | value | A value tag to examine. |
Returns
Type | Description |
---|---|
ValueTag | The set representative for the set of all values equivalent
with |
TryGetNumber(Instruction, out ValueTag)
Tries to compute the value number of an instruction.
Declaration
public abstract bool TryGetNumber(Instruction instruction, out ValueTag number)
Parameters
Type | Name | Description |
---|---|---|
Instruction | instruction | The instruction to number. |
ValueTag | number | A value number if a value is found that is equivalent
to |
Returns
Type | Description |
---|---|
System.Boolean |
|