Interface ILinearInstructionSelector<TInstruction>
An instruction selection algorithm for instruction sets that produce linear streams of instructions, that is, control flow is expressed using branches to branch targets.
Inherited Members
Namespace: Flame.Compiler.Target
Assembly: Flame.Compiler.dll
Syntax
public interface ILinearInstructionSelector<TInstruction> : IInstructionSelector<TInstruction>
Type Parameters
Name | Description |
---|---|
TInstruction | The type of instructions to produce. |
Methods
| Improve this Doc View SourceCreateBlockMarker(BasicBlock)
Creates a sequence of instructions that declare the start of a basic block.
Declaration
IReadOnlyList<TInstruction> CreateBlockMarker(BasicBlock block)
Parameters
Type | Name | Description |
---|---|---|
BasicBlock | block | The basic block to mark. |
Returns
Type | Description |
---|---|
System.Collections.Generic.IReadOnlyList<TInstruction> | A sequence of instructions that mark a block. |
CreateJumpTo(BasicBlockTag)
Creates an unconditional jump to a particular branch target.
Declaration
IReadOnlyList<TInstruction> CreateJumpTo(BasicBlockTag target)
Parameters
Type | Name | Description |
---|---|---|
BasicBlockTag | target | A basic block tag that uniquely identifies a branch target. |
Returns
Type | Description |
---|---|
System.Collections.Generic.IReadOnlyList<TInstruction> | An unconditional jump. |
SelectInstructions(BlockFlow, BasicBlockTag, FlowGraph, BasicBlockTag, out BasicBlockTag)
Selects instructions for a particular IR block flow.
Declaration
SelectedFlowInstructions<TInstruction> SelectInstructions(BlockFlow flow, BasicBlockTag blockTag, FlowGraph graph, BasicBlockTag preferredFallthrough, out BasicBlockTag fallthrough)
Parameters
Type | Name | Description |
---|---|---|
BlockFlow | flow | The IR block flow to translate to target-specific instructions. |
BasicBlockTag | blockTag | The tag of the basic block that defines the flow. |
FlowGraph | graph | The IR graph that defines the flow. |
BasicBlockTag | preferredFallthrough | A preferred fallthrough block, which will likely result in better
codegen if chosen as fallthrough. May be |
BasicBlockTag | fallthrough | The fallthrough block expected by the selected instruction, if any. |
Returns
Type | Description |
---|---|
SelectedFlowInstructions<TInstruction> | A batch of selected instructions. |