Struct cranefack::OptimizeConfig[][src]

pub struct OptimizeConfig {
    pub max_loops: usize,
    pub complex_loops: bool,
    pub non_local: bool,
    pub jit_level: Option<String>,
    pub unroll_loop_limit: usize,
    pub partially_unroll_loops_limit: usize,
    pub wrapping_is_ub: bool,
    pub debug: bool,
}
Expand description

Configuration to control optimization of the program

Fields

max_loops: usize

Maximum of optimization loops. Use zero to disable optimization

complex_loops: bool

Optimize complex loops

non_local: bool

Run non local optimizations passes

jit_level: Option<String>

Optimization level passed to cranelift

Currently this supports none, speed and speed_and_size.
By default speed is used for all levels expect 0

unroll_loop_limit: usize

Limit for loop unrolling pass

partially_unroll_loops_limit: usize

Limit for partially unrolling loops known to be take at least one time

wrapping_is_ub: bool

Define wrapping integer overflow as undefined behavior

Allows some optimization to mark values as non zero if there is a known increment

debug: bool

Print statistics after each pass

Implementations

Don’t do any optimization

Only simple optimizations

Complex loop and non local optimizations

Unroll more loops

Try to keep size small

Turn on all optimization passes on the max

Only useful for testing…

Check if configuration has an optimization enabled

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.