Show / Hide Table of Contents

    Class SwitchSimplification

    An optimization that transforms switch flows in a way that makes it easier for other optimizations to reason about said switches.

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

    Fields

    | Improve this Doc View Source

    Instance

    An instance of the switch simplification optimization.

    Declaration
    public static readonly SwitchSimplification Instance
    Field Value
    Type Description
    SwitchSimplification

    Methods

    | Improve this Doc View Source

    Apply(FlowGraph)

    Simplifies switches in a particular flow graph.

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

    The graph to transform.

    Returns
    Type Description
    FlowGraph

    A transformed graph.

    Overrides
    IntraproceduralOptimization.Apply(FlowGraph)
    | Improve this Doc View Source

    TrySimplifySwitchFlow(BasicBlockBuilder)

    Tries to simplify a basic block's switch flow, provided that the block ends in switch flow.

    Declaration
    public static bool TrySimplifySwitchFlow(BasicBlockBuilder block)
    Parameters
    Type Name Description
    BasicBlockBuilder block

    The basic block to simplify.

    Returns
    Type Description
    System.Boolean

    true if the block's flow was simplified; otherwise, false.

    • Improve this Doc
    • View Source
    Back to top Generated by DocFX