#[repr(u8)]pub enum Pass {
CommonSubexpressionElimination = 1,
ConstantCommuting = 2,
ConstantFolding = 4,
StrengthReduction = 8,
DeadCodeElimination = 16,
RegisterCoalescing = 128,
}Expand description
A standard optimization. Each pass applies a single optimization to a function. Each pass is represented as a single bit in a bitfield of passes. The passes are performed by the standard optimizer in definition order.
Variants§
CommonSubexpressionElimination = 1
Eliminate common subexpressions by identifying and replacing identical expressions. Iterate until no further changes are made.
ConstantCommuting = 2
Commute immediate operands to the left side of instructions, thereby creating new opportunities for constant folding and strength reduction. Iterate until no further changes are made.
ConstantFolding = 4
Fold expressions with constant operands into immediates. Iterate until no further changes are made.
StrengthReduction = 8
Reduce the strength of expressions by replacing expensive operations with cheaper ones. Only a single iteration is performed.
DeadCodeElimination = 16
Eliminate dead code by removing instructions whose results are never used. Iterate until no further changes are made.
RegisterCoalescing = 128
Coalesce registers by merging equivalent registers. This pass breaks SSA form, so it is the final pass.
Trait Implementations§
Source§impl BitOrAssign<Pass> for Passes
impl BitOrAssign<Pass> for Passes
Source§fn bitor_assign(&mut self, rhs: Pass)
fn bitor_assign(&mut self, rhs: Pass)
|= operation. Read moreimpl Copy for Pass
impl Eq for Pass
impl StructuralPartialEq for Pass
Auto Trait Implementations§
impl Freeze for Pass
impl RefUnwindSafe for Pass
impl Send for Pass
impl Sync for Pass
impl Unpin for Pass
impl UnwindSafe for Pass
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more