Skip to main content

combine_stack_layouts

Function combine_stack_layouts 

Source
pub fn combine_stack_layouts(
    layouts: &[BlockStackLayout],
) -> Option<BlockStackLayout>
Expand description

Computes a common stack layout for multiple incoming edges at a merge point.

The algorithm:

  1. Find values that appear in multiple incoming layouts at the same position
  2. For values at different positions, choose the position with lowest total shuffle cost
  3. Values only needed by one predecessor become “junk slots” for others

Returns None if the layouts are incompatible (too many different values).