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.
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.Transforms
Assembly: Flame.Compiler.dll
Syntax
public sealed class PartialScalarReplacement : IntraproceduralOptimization
Constructors
| Improve this Doc View SourcePartialScalarReplacement(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 SourceInstance
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 SourceCanReplaceByScalars
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 SourceApply(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. |