Show / Hide Table of Contents

    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
    System.Object
    ValueNumberingInstructionComparer
    Implements
    System.Collections.Generic.IEqualityComparer<Instruction>
    Inherited Members
    System.Object.ToString()
    System.Object.Equals(System.Object)
    System.Object.Equals(System.Object, System.Object)
    System.Object.ReferenceEquals(System.Object, System.Object)
    System.Object.GetHashCode()
    System.Object.GetType()
    System.Object.MemberwiseClone()
    Namespace: Flame.Compiler.Analysis
    Assembly: Flame.Compiler.dll
    Syntax
    public sealed class ValueNumberingInstructionComparer : IEqualityComparer<Instruction>

    Constructors

    | Improve this Doc View Source

    ValueNumberingInstructionComparer(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 Source

    Equals(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

    true if the instructions are equivalent; otherwise, false.

    | Improve this Doc View Source

    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.

    Implements

    System.Collections.Generic.IEqualityComparer<T>
    • Improve this Doc
    • View Source
    Back to top Generated by DocFX