pub struct PassStats { /* private fields */ }Expand description
How often one pass ran and how often it changed something.
§Examples
use ir_lang::{Linkage, Module, Signature, Type};
use opt_lang::PassKind;
let mut m = Module::new("m");
let f = m.declare_function("f", &Signature::new(&[], &[Type::I32]), Linkage::Export)?;
let mut b = m.build(f)?;
let dead = b.iconst(Type::I32, 1)?;
let live = b.iconst(Type::I32, 2)?;
b.ret(&[live])?;
let stats = opt_lang::optimize(&mut m)?;
let dce = stats.pass(PassKind::Dce);
assert!(dce.runs() >= 1 && dce.changes() >= 1);Implementations§
Source§impl PassStats
impl PassStats
Sourcepub const fn kind(&self) -> PassKind
pub const fn kind(&self) -> PassKind
The pass.
§Examples
use opt_lang::{PassKind, Stats};
assert_eq!(Stats::default().pass(PassKind::Gvn).kind(), PassKind::Gvn);Trait Implementations§
impl Copy for PassStats
impl Eq for PassStats
impl StructuralPartialEq for PassStats
Auto Trait Implementations§
impl Freeze for PassStats
impl RefUnwindSafe for PassStats
impl Send for PassStats
impl Sync for PassStats
impl Unpin for PassStats
impl UnsafeUnpin for PassStats
impl UnwindSafe for PassStats
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more