pub struct OptimizationConfig {
pub moveable_functions: Vec<String>,
pub inline_small_functions_threshold: usize,
pub inlining_strategy: InliningStrategy,
pub skip_const_folding: bool,
}
Expand description
A configuration struct that controls the behavior of the optimization passes.
Fields§
§moveable_functions: Vec<String>
A list of functions that can be moved during the reorder_statements optimization.
inline_small_functions_threshold: usize
The size of functions (in lowering statements) below which they are marked as
should_inline
.
inlining_strategy: InliningStrategy
Determines whether inlining is disabled.
skip_const_folding: bool
Should const folding be skipped.
Implementations§
Source§impl OptimizationConfig
impl OptimizationConfig
Sourcepub fn with_moveable_functions(self, moveable_functions: Vec<String>) -> Self
pub fn with_moveable_functions(self, moveable_functions: Vec<String>) -> Self
Sets the list of moveable functions.
Sourcepub fn with_minimal_movable_functions(self) -> Self
pub fn with_minimal_movable_functions(self) -> Self
Sets the list of moveable functions to a minimal set, useful for testing.
Sourcepub fn with_inline_small_functions_threshold(
self,
inline_small_functions_threshold: usize,
) -> Self
pub fn with_inline_small_functions_threshold( self, inline_small_functions_threshold: usize, ) -> Self
Sets the threshold for inlining small functions.
Sourcepub fn with_inlining_strategy(self, inlining_strategy: InliningStrategy) -> Self
pub fn with_inlining_strategy(self, inlining_strategy: InliningStrategy) -> Self
Sets the inlining_strategy
flag.
Sourcepub fn with_skip_const_folding(self, skip_const_folding: bool) -> Self
pub fn with_skip_const_folding(self, skip_const_folding: bool) -> Self
Sets the skip_const_folding
flag.
Trait Implementations§
Source§impl Clone for OptimizationConfig
impl Clone for OptimizationConfig
Source§fn clone(&self) -> OptimizationConfig
fn clone(&self) -> OptimizationConfig
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for OptimizationConfig
impl Debug for OptimizationConfig
Source§impl Default for OptimizationConfig
impl Default for OptimizationConfig
Source§impl PartialEq for OptimizationConfig
impl PartialEq for OptimizationConfig
impl Eq for OptimizationConfig
impl StructuralPartialEq for OptimizationConfig
Auto Trait Implementations§
impl Freeze for OptimizationConfig
impl RefUnwindSafe for OptimizationConfig
impl Send for OptimizationConfig
impl Sync for OptimizationConfig
impl Unpin for OptimizationConfig
impl UnwindSafe for OptimizationConfig
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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>
Converts
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>
Converts
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