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§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)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