pub struct Liveness { /* private fields */ }Expand description
What is live at the edges of every block.
Per block rather than per instruction, because the sets inside a block are recoverable from the
live-out by walking the block backwards and nothing wants to pay for storing them.
Liveness::through is that walk, and the pressure model is its first caller.
Implementations§
Source§impl Liveness
impl Liveness
Sourcepub fn live_in(&self, block: Block) -> impl Iterator<Item = Value> + use<'_>
pub fn live_in(&self, block: Block) -> impl Iterator<Item = Value> + use<'_>
What is live when control arrives at the block, which excludes its own parameters.
Sourcepub fn live_out(&self, block: Block) -> impl Iterator<Item = Value> + use<'_>
pub fn live_out(&self, block: Block) -> impl Iterator<Item = Value> + use<'_>
What is live when control leaves it.
Sourcepub fn is_live_in(&self, block: Block, value: Value) -> bool
pub fn is_live_in(&self, block: Block, value: Value) -> bool
Whether that value is live on the way in.
Sourcepub fn is_live_out(&self, block: Block, value: Value) -> bool
pub fn is_live_out(&self, block: Block, value: Value) -> bool
Whether that value is live on the way out.
Sourcepub fn through(
&self,
func: &Func,
block: Block,
at: impl FnMut(Inst, &LiveHere<'_>),
)
pub fn through( &self, func: &Func, block: Block, at: impl FnMut(Inst, &LiveHere<'_>), )
Walks the block backwards from its live-out, calling at before each instruction with what
is live there.
This is where the per instruction sets come from, for the callers that want them. The set
handed to at is what is live just before that instruction runs, so it holds the
instruction’s operands and not its results.