Skip to main content

solar_codegen/backend/evm/stack/
mod.rs

1//! Stack scheduling for EVM code generation.
2//!
3//! This module handles the translation from MIR's SSA values to EVM's stack-based model.
4//! The key abstraction is `StackModel`, which tracks which MIR values are at which stack depths.
5//!
6//! ## Submodules
7//!
8//! - `model`: Core stack model tracking value positions
9//! - `scheduler`: Stack scheduler for generating DUP/SWAP sequences
10//! - `shuffler`: Optimal stack layout transitions (backward analysis)
11//! - `spill`: Spill management for values beyond depth 16
12
13mod model;
14mod scheduler;
15pub mod shuffler;
16mod spill;
17
18pub(crate) use model::MAX_STACK_ACCESS;
19pub use model::{StackModel, StackOp};
20pub use scheduler::{ScheduledOp, StackScheduler};
21pub use shuffler::{
22    BlockStackLayout, LayoutAnalysis, ShuffleResult, StackShuffler, TargetSlot,
23    combine_stack_layouts, estimate_shuffle_cost, ideal_binary_op_entry, ideal_operand_layout,
24    ideal_unary_op_entry, is_freely_generable,
25};
26pub use spill::{SpillManager, SpillSlot};