[−][src]Struct cranelift_codegen::machinst::vcode::VCode
A function in "VCode" (virtualized-register code) form, after lowering. This is essentially a standard CFG of basic blocks, where each basic block consists of lowered instructions produced by the machine-specific backend.
Methods
impl<I: VCodeInst> VCode<I>
[src]
pub fn flags(&self) -> &Flags
[src]
Returns the flags controlling this function's compilation.
pub fn vreg_type(&self, vreg: VirtualReg) -> Type
[src]
Get the IR-level type of a VReg.
pub fn entry(&self) -> BlockIndex
[src]
Get the entry block.
pub fn num_blocks(&self) -> usize
[src]
Get the number of blocks. Block indices will be in the range 0 .. (self.num_blocks() - 1)
.
pub fn frame_size(&self) -> u32
[src]
Stack frame size for the full function's body.
pub fn succs(&self, block: BlockIndex) -> &[BlockIndex]
[src]
Get the successors for a block.
pub fn replace_insns_from_regalloc(&mut self, result: RegAllocResult<Self>)
[src]
Take the results of register allocation, with a sequence of instructions including spliced fill/reload/move instructions, and replace the VCode with them.
pub fn remove_redundant_branches(&mut self)
[src]
Removes redundant branches, rewriting targets to point directly to the ultimate block at the end of a chain of trivial one-target jumps.
pub fn finalize_branches(&mut self) where
I: MachInstEmit<MachSectionSize>,
[src]
I: MachInstEmit<MachSectionSize>,
Mutate branch instructions to (i) lower two-way condbrs to one-way, depending on fallthrough; and (ii) use concrete offsets.
pub fn emit(&self) -> MachSections where
I: MachInstEmit<MachSection>,
[src]
I: MachInstEmit<MachSection>,
Emit the instructions to a list of sections.
pub fn bindex_to_bb(&self, block: BlockIndex) -> Option<Block>
[src]
Get the IR block for a BlockIndex, if one exists.
Trait Implementations
impl<I: VCodeInst> Debug for VCode<I>
[src]
impl<I: VCodeInst> Function for VCode<I>
[src]
type Inst = I
Regalloc is parameterized on F: Function and so can use the projected type F::Inst. Read more
fn insns(&self) -> &[I]
[src]
fn insns_mut(&mut self) -> &mut [I]
[src]
fn get_insn(&self, insn: InstIx) -> &I
[src]
fn get_insn_mut(&mut self, insn: InstIx) -> &mut I
[src]
fn blocks(&self) -> Range<BlockIx>
[src]
fn entry_block(&self) -> BlockIx
[src]
fn block_insns(&self, block: BlockIx) -> Range<InstIx>
[src]
fn block_succs(&self, block: BlockIx) -> Vec<BlockIx>
[src]
fn is_ret(&self, insn: InstIx) -> bool
[src]
fn get_regs(insn: &I, collector: &mut RegUsageCollector)
[src]
fn map_regs(insn: &mut I, mapper: &RegUsageMapper)
[src]
fn is_move(&self, insn: &I) -> Option<(Writable<Reg>, Reg)>
[src]
fn get_vreg_count_estimate(&self) -> Option<usize>
[src]
fn get_spillslot_size(&self, regclass: RegClass, vreg: VirtualReg) -> u32
[src]
fn gen_spill(
&self,
to_slot: SpillSlot,
from_reg: RealReg,
vreg: VirtualReg
) -> I
[src]
&self,
to_slot: SpillSlot,
from_reg: RealReg,
vreg: VirtualReg
) -> I
fn gen_reload(
&self,
to_reg: Writable<RealReg>,
from_slot: SpillSlot,
vreg: VirtualReg
) -> I
[src]
&self,
to_reg: Writable<RealReg>,
from_slot: SpillSlot,
vreg: VirtualReg
) -> I
fn gen_move(
&self,
to_reg: Writable<RealReg>,
from_reg: RealReg,
vreg: VirtualReg
) -> I
[src]
&self,
to_reg: Writable<RealReg>,
from_reg: RealReg,
vreg: VirtualReg
) -> I
fn gen_zero_len_nop(&self) -> I
[src]
fn maybe_direct_reload(
&self,
insn: &I,
reg: VirtualReg,
slot: SpillSlot
) -> Option<I>
[src]
&self,
insn: &I,
reg: VirtualReg,
slot: SpillSlot
) -> Option<I>
fn func_liveins(&self) -> RegallocSet<RealReg>
[src]
fn func_liveouts(&self) -> RegallocSet<RealReg>
[src]
fn insn_indices(&self) -> Range<InstIx>
[src]
impl<I: VCodeInst + ShowWithRRU> ShowWithRRU for VCode<I>
[src]
Pretty-printing with RealRegUniverse
context.
fn show_rru(&self, mb_rru: Option<&RealRegUniverse>) -> String
[src]
fn show_rru_sized(&self, mb_rru: Option<&RealRegUniverse>, _size: u8) -> String
[src]
Auto Trait Implementations
impl<I> !RefUnwindSafe for VCode<I>
impl<I> !Send for VCode<I>
impl<I> !Sync for VCode<I>
impl<I> Unpin for VCode<I> where
I: Unpin,
I: Unpin,
impl<I> !UnwindSafe for VCode<I>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,