Show / Hide Table of Contents

    Class ScalarReplacement

    The scalar replacement of aggregates transform, which tries to decompose local variables of aggregate types, replacing them with other local variables that represent their fields.

    Inheritance
    System.Object
    Optimization
    IntraproceduralOptimization
    ScalarReplacement
    Inherited Members
    IntraproceduralOptimization.IsCheckpoint
    IntraproceduralOptimization.ApplyAsync(MethodBody, OptimizationState)
    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.Transforms
    Assembly: Flame.Compiler.dll
    Syntax
    public sealed class ScalarReplacement : IntraproceduralOptimization

    Constructors

    | Improve this Doc View Source

    ScalarReplacement(Func<IType, Boolean>)

    Creates a scalar replacement of aggregates pass.

    Declaration
    public ScalarReplacement(Func<IType, bool> canAccessFields)
    Parameters
    Type Name Description
    System.Func<IType, System.Boolean> canAccessFields

    A predicate that tells if all fields in a type can be accessed for the purpose of scalar replacement.

    Fields

    | Improve this Doc View Source

    Instance

    An instance of the scalar replacement transform.

    Declaration
    public static readonly Optimization Instance
    Field Value
    Type Description
    Optimization

    Properties

    | Improve this Doc View Source

    CanAccessFields

    Tells if all fields in a type can be accessed for the purpose of scalar replacement.

    Declaration
    public Func<IType, bool> CanAccessFields { get; }
    Property Value
    Type Description
    System.Func<IType, System.Boolean>

    A predicate.

    Methods

    | Improve this Doc View Source

    Apply(FlowGraph)

    Applies this intraprocedural optimization to a flow graph.

    Declaration
    public override FlowGraph Apply(FlowGraph graph)
    Parameters
    Type Name Description
    FlowGraph graph

    The flow graph to transform.

    Returns
    Type Description
    FlowGraph

    A transformed flow graph.

    Overrides
    IntraproceduralOptimization.Apply(FlowGraph)
    • Improve this Doc
    • View Source
    Back to top Generated by DocFX