Class BlockFixpointAnalysis<TBlockState>
A base class for analyses that process blocks until they reach a fixpoint.
Inheritance
Implements
Inherited Members
Namespace: Flame.Compiler.Analysis
Assembly: Flame.Compiler.dll
Syntax
public abstract class BlockFixpointAnalysis<TBlockState> : IFlowGraphAnalysis<BlockFixpointAnalysis<TBlockState>.Result>
Type Parameters
Name | Description |
---|---|
TBlockState | The result of analyzing a single block. |
Methods
| Improve this Doc View SourceAnalyze(FlowGraph)
Declaration
public BlockFixpointAnalysis<TBlockState>.Result Analyze(FlowGraph graph)
Parameters
Type | Name | Description |
---|---|---|
FlowGraph | graph |
Returns
Type | Description |
---|---|
BlockFixpointAnalysis.Result<> |
AnalyzeWithUpdates(FlowGraph, BlockFixpointAnalysis<TBlockState>.Result, IReadOnlyList<FlowGraphUpdate>)
Declaration
public BlockFixpointAnalysis<TBlockState>.Result AnalyzeWithUpdates(FlowGraph graph, BlockFixpointAnalysis<TBlockState>.Result previousResult, IReadOnlyList<FlowGraphUpdate> updates)
Parameters
Type | Name | Description |
---|---|---|
FlowGraph | graph | |
BlockFixpointAnalysis.Result<> | previousResult | |
System.Collections.Generic.IReadOnlyList<FlowGraphUpdate> | updates |
Returns
Type | Description |
---|---|
BlockFixpointAnalysis.Result<> |
CreateEntryPointInput(BasicBlock)
Creates an input block state for an entry point block.
Declaration
public abstract TBlockState CreateEntryPointInput(BasicBlock entryPoint)
Parameters
Type | Name | Description |
---|---|---|
BasicBlock | entryPoint | The entry point block to create a state for. |
Returns
Type | Description |
---|---|
TBlockState | An input block state for the entry point. |
Equals(TBlockState, TBlockState)
Tests if two block states are the same.
Declaration
public abstract bool Equals(TBlockState first, TBlockState second)
Parameters
Type | Name | Description |
---|---|---|
TBlockState | first | The first block state to compare. |
TBlockState | second | The second block state to compare. |
Returns
Type | Description |
---|---|
System.Boolean |
|
GetOutgoingInputs(BasicBlock, TBlockState)
Gets a block's outgoing inputs: a sequence of key-value pairs where the keys list affected blocks and the values list values that should be merged with those blocks' inputs.
Declaration
public virtual IEnumerable<KeyValuePair<BasicBlockTag, TBlockState>> GetOutgoingInputs(BasicBlock block, TBlockState output)
Parameters
Type | Name | Description |
---|---|---|
BasicBlock | block | A basic block. |
TBlockState | output | The output for that basic block, as computed by the |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<BasicBlockTag, TBlockState>> | A sequence of key-value pairs. |
Merge(TBlockState, TBlockState)
Merges two block states. This method unifies outgoing block states into a single input block state.
Declaration
public abstract TBlockState Merge(TBlockState first, TBlockState second)
Parameters
Type | Name | Description |
---|---|---|
TBlockState | first | A first block state. |
TBlockState | second | A second block state. |
Returns
Type | Description |
---|---|
TBlockState | A merged block state. |
Process(BasicBlock, TBlockState)
Processes a block's contents.
Declaration
public abstract TBlockState Process(BasicBlock block, TBlockState input)
Parameters
Type | Name | Description |
---|---|---|
BasicBlock | block | A block to process. |
TBlockState | input | The block's input state. |
Returns
Type | Description |
---|---|
TBlockState | The block's output state. |