feat: Implement closure cracking and inlining
Introduces a new optimizer pass that can "crack" closures, allowing for more aggressive specialization. It also enables inlining of upvalues that point to immutable global variables. This removes overhead for higher-order functions and currying when arguments are statically resolvable.
This commit is contained in:
@@ -30,11 +30,16 @@ struct Cli {
|
||||
/// Run with TracingObserver enabled
|
||||
#[arg(short, long)]
|
||||
trace: bool,
|
||||
|
||||
/// Optimization level (0: None, 1: Cracking, 2: Aggressive)
|
||||
#[arg(short, long, default_value_t = 0)]
|
||||
opt: u32,
|
||||
}
|
||||
|
||||
fn main() {
|
||||
let cli = Cli::parse();
|
||||
let mut env = Environment::new();
|
||||
env.optimization_level = cli.opt;
|
||||
|
||||
if cli.bench || cli.update_bench {
|
||||
if cfg!(debug_assertions) {
|
||||
|
||||
Reference in New Issue
Block a user