Class ValueNumberingInstructionComparer
A specialized instruction comparer for instructions that uses value numbers to more accurately compare instructions. Assumes that all instructions being compared are defined by the same graph. The equality relation that arises from this comparer is that of semantic instruction equivalence, not of syntactic equality.
Inheritance
Implements
Inherited Members
Namespace: Flame.Compiler.Analysis
Assembly: Flame.Compiler.dll
Syntax
public sealed class ValueNumberingInstructionComparer : IEqualityComparer<Instruction>
Constructors
| Improve this Doc View SourceValueNumberingInstructionComparer(ValueNumbering)
Creates an instruction comparer that uses a value numbering to decide if two instructions are equivalent.
Declaration
public ValueNumberingInstructionComparer(ValueNumbering numbering)
Parameters
Type | Name | Description |
---|---|---|
ValueNumbering | numbering | The value numbering to use for deciding if instructions are equivalent. |
Methods
| Improve this Doc View SourceEquals(Instruction, Instruction)
Tests if two instructions are equivalent in a value numbering sense. 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 bool Equals(Instruction a, Instruction b)
Parameters
Type | Name | Description |
---|---|---|
Instruction | a | The first instruction to compare. |
Instruction | b | The second instruction to compare. |
Returns
Type | Description |
---|---|
System.Boolean |
|
GetHashCode(Instruction)
Computes a hash code for an instruction.
Declaration
public int GetHashCode(Instruction obj)
Parameters
Type | Name | Description |
---|---|---|
Instruction | obj | The instruction to hash. |
Returns
Type | Description |
---|---|
System.Int32 | A hash code. |