56b8e8389b
The optimizer has been refactored to separate its phases and introduce more aggressive collapsing capabilities. Phase 2 (Cracking) now focuses on stateless transformations, making it easier to reason about and potentially parallelize. Phase 2.5 (Aggressive Collapsing) has been introduced, enabling optimizations like: - Beta-reduction for lambda literals. - Cracking and inlining for constant closures. - Folding intrinsics for constant arithmetic. - Short-circuiting conditional expressions. These changes aim to improve performance by reducing redundant computations and code bloat. The maximum number of optimization passes has also been increased to 5 to allow for more complex transformations.