pub struct DSEPass { /* private fields */ }Expand description
The main Dead Store Elimination pass.
Implementations§
Source§impl DSEPass
impl DSEPass
pub fn new(config: DeadStoreConfig) -> Self
Sourcepub fn run(&mut self, decls: &mut [LcnfFunDecl])
pub fn run(&mut self, decls: &mut [LcnfFunDecl])
Run the DSE pass over all function declarations, removing dead stores in-place.
Sourcepub fn compute_liveness(&self, decl: &LcnfFunDecl) -> LivenessInfo
pub fn compute_liveness(&self, decl: &LcnfFunDecl) -> LivenessInfo
Compute liveness information for all variables in decl using a
backward dataflow pass.
Sourcepub fn find_dead_stores(
&mut self,
decl: &LcnfFunDecl,
liveness: &LivenessInfo,
) -> HashSet<LcnfVarId>
pub fn find_dead_stores( &mut self, decl: &LcnfFunDecl, liveness: &LivenessInfo, ) -> HashSet<LcnfVarId>
Identify variables that are defined but never used (dead stores).
Returns the set of variable ids whose let-bindings can be removed.
Sourcepub fn eliminate_dead_stores(
&self,
decl: &mut LcnfFunDecl,
dead: &HashSet<LcnfVarId>,
)
pub fn eliminate_dead_stores( &self, decl: &mut LcnfFunDecl, dead: &HashSet<LcnfVarId>, )
Remove all let-bindings for variables in dead from decl.body.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for DSEPass
impl RefUnwindSafe for DSEPass
impl Send for DSEPass
impl Sync for DSEPass
impl Unpin for DSEPass
impl UnsafeUnpin for DSEPass
impl UnwindSafe for DSEPass
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