cairo_lang_lowering::optimizations::reorder_statements

Function reorder_statements

source
pub fn reorder_statements(db: &dyn LoweringGroup, lowered: &mut FlatLowered)
Expand description

Reorder the statements in the lowering in order to move variable definitions closer to their usage. Statement with no side effects and unused outputs are removed.

The list of call statements that can be moved is currently hardcoded.

Removing unnecessary remapping before this optimization will result in better code.