Show / Hide Table of Contents

    Class PartialScalarReplacement

    An optimization that replaces aggregates by scalars, i.e., their fields. Depending on the control-flow graph, aggregates might be replaced by scalars on some control-flow paths while remaining untouched on others.

    Inheritance
    System.Object
    Optimization
    IntraproceduralOptimization
    PartialScalarReplacement
    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 PartialScalarReplacement : IntraproceduralOptimization

    Constructors

    | Improve this Doc View Source

    PartialScalarReplacement(Func<IType, Boolean>)

    Creates a partial scalar replacement pass.

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

    Tells if a type is an aggregate that can be replaced by scalars.

    Fields

    | Improve this Doc View Source

    Instance

    An instance of the partial scalar replacement transform.

    Declaration
    public static readonly Optimization Instance
    Field Value
    Type Description
    Optimization

    A partial scalar replacement transform instance.

    Properties

    | Improve this Doc View Source

    CanReplaceByScalars

    Tells if a particular type is an aggregate that can be replaced by scalars.

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

    A predicate function.

    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