basic-block


Vocabulary
compiler.cfg

Class description
Factors representation of a basic block in the Call Flow Graph (CFG). A basic block is a sequence of instructions that always are executed sequentially and doesn't contain any internal branching. It has the following slots:
numberThe blocks sequence number. Generated by calling number-blocks.
successorsA vector of basic blocks that may be executed directly after this block. Most blocks only have one successor but a block that checks where an if-condition should branch to would have two for example.
predecessorsThe opposite of successors -- a vector of basic blocks from which the execution may have arrived into this block.
instructionsA vector of insn tuples which form the instructions of the basic block.
kill-block?The first and the last block in a cfg and all blocks containing ##call instructions are kill blocks. Kill blocks can't be optimized so they are omitted from certain optimization steps.
heightBlock's height as a height-state. What the heights of the block was at entry and how much they were increased in the block.
replacesUsed by compiler.cfg.stacks.local for local stack analysis.
peeksUsed by compiler.cfg.stacks.local for local stack analysis.
killsUsed by compiler.cfg.stacks.local for local stack analysis.


Notes
A basic-block is an identity-tuple because it is used as a hash table key by the compiler.

Definition


TUPLE: basic-block < identity-tuple
number
{ instructions vector initial: V{ } }
{ successors vector initial: V{ } }
{ predecessors vector initial: V{ } }
{ kill-block? boolean initial: f } height replaces peeks
kills ;