pub struct BlockData {
pub params: Vec<Value>,
pub first: Option<Inst>,
pub last: Option<Inst>,
pub prev: Option<Block>,
pub next: Option<Block>,
}Expand description
One basic block: parameters, then instructions, then exactly one terminator.
The instructions are a doubly linked list rather than a vector, so that inserting one in
the middle of a block does not move the ones after it. An optimizer does that constantly,
and a move would invalidate every Inst anybody was holding.
Fields§
§params: Vec<Value>The values arriving here, which is what other IRs spell as phi nodes.
A Vec and not a run in a pool, because SSA construction adds a parameter to a loop
header long after the blocks that come after it have been built, and a run in a pool
cannot grow in the middle.
first: Option<Inst>The first instruction, or None for a block nothing has been put in yet.
last: Option<Inst>The last instruction, which is the terminator once the block is finished.
prev: Option<Block>The block before this one in layout order.
next: Option<Block>The block after it.