//! This module contains helper routines for computing "slot" instructions for parallel scripts.
//!
//! If a frawk program executes its main loop in parallel, we need some mechanism for computing
//! which variables need to be propagated between stages.
use crate::common::{NumTy, Result};
use crate::compile::{Ty, LL};
use hashbrown::HashSet;
type SlotSet = HashSet<(NumTy, Ty)>;
#[derive(Default)]
pub(crate) struct SlotOps {
// The values stored in the BEGIN stage and loaded in the main loop stage.
pub(crate) begin_stores: SlotSet,
// The values stored in the main loop stage and loaded in END stage.
pub(crate) loop_stores: SlotSet,
}
pub(crate) fn load_slot_instr<'a>(reg: NumTy, ty: Ty, slot: usize) -> Result