#[non_exhaustive]pub struct ParserOptions {
pub optimize_local_memory_allocation: bool,
pub optimize_rewrite: bool,
pub optimize_remove_nop: bool,
pub parser_threads: Option<usize>,
}Expand description
Parser optimization and lowering options.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.optimize_local_memory_allocation: boolWhether to optimize local memory allocation by skipping allocation of unused local memories.
optimize_rewrite: boolWhether to run the peephole rewrite optimizer.
optimize_remove_nop: boolWhether to remove Nop and MergeBarrier instructions after rewriting.
parser_threads: Option<usize>Number of threads to use for parallel parsing.
Requires the parallel feature. Ignored when the feature is disabled.
None: auto-detect based on available parallelismSome(1): force single-threadedSome(n): use up tonworkers
Implementations§
Source§impl ParserOptions
impl ParserOptions
Sourcepub const fn with_local_memory_allocation_optimization(
self,
enabled: bool,
) -> Self
pub const fn with_local_memory_allocation_optimization( self, enabled: bool, ) -> Self
Enable or disable the optimization that skips allocating unused local memories.
Sourcepub const fn optimize_local_memory_allocation(&self) -> bool
pub const fn optimize_local_memory_allocation(&self) -> bool
Returns whether unused local memory allocation optimization is enabled.
Sourcepub const fn with_rewrite_optimization(self, enabled: bool) -> Self
pub const fn with_rewrite_optimization(self, enabled: bool) -> Self
Enable or disable the peephole rewrite optimizer.
Sourcepub const fn optimize_rewrite(&self) -> bool
pub const fn optimize_rewrite(&self) -> bool
Returns whether the peephole rewrite optimizer is enabled.
Sourcepub const fn with_nop_removal_optimization(self, enabled: bool) -> Self
pub const fn with_nop_removal_optimization(self, enabled: bool) -> Self
Enable or disable Nop/MergeBarrier removal after rewriting.
Sourcepub const fn optimize_remove_nop(&self) -> bool
pub const fn optimize_remove_nop(&self) -> bool
Returns whether Nop/MergeBarrier removal is enabled.
Sourcepub const fn with_parser_threads(self, threads: usize) -> Self
pub const fn with_parser_threads(self, threads: usize) -> Self
Set the number of threads for parallel parsing.
Requires the parallel feature to have any effect.
Sourcepub const fn parser_threads(&self) -> Option<usize>
pub const fn parser_threads(&self) -> Option<usize>
Returns the configured parser thread count, or None for auto-detect.
Trait Implementations§
Source§impl Clone for ParserOptions
impl Clone for ParserOptions
Source§fn clone(&self) -> ParserOptions
fn clone(&self) -> ParserOptions
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more