Struct debris_llir::opt::optimizers::const_optimizer::ConstOptimizer
source · pub struct ConstOptimizer {
value_hints: ValueHints,
}
Expand description
Optimizes nodes which are const-evaluatable.
This optimizer tracks all const assignments to variables in
a given function and replaces reads from const variables by their
const value. Also contains functionality to evaluate BinaryOperation
and Condition
.
In order to be more efficient, this optimizer optimizes an entire function.
This means that the current state must always be synced correctly!
Fields§
§value_hints: ValueHints
Implementations§
source§impl ConstOptimizer
impl ConstOptimizer
pub fn optimize_node( &mut self, commands: &mut OptimizeCommandDeque<OptimizeCommand>, node_id: (BlockId, usize), node: &Node ) -> bool
Trait Implementations§
source§impl Default for ConstOptimizer
impl Default for ConstOptimizer
source§fn default() -> ConstOptimizer
fn default() -> ConstOptimizer
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl RefUnwindSafe for ConstOptimizer
impl Send for ConstOptimizer
impl Sync for ConstOptimizer
impl Unpin for ConstOptimizer
impl UnwindSafe for ConstOptimizer
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