weirflow 0.1.0

GPU-first dataflow analysis primitives for Vyre and Santh compiler pipelines.
Documentation
#![cfg(any(test, feature = "cpu-parity"))]

/// Reference oracle for loop summarization.
#[must_use]
#[allow(deprecated)]
pub fn loop_summarize(cfg_in: &[u32], ranges_in: &[u32], var_count: u32) -> Vec<u32> {
    crate::loop_sum::loop_summarize_cpu(cfg_in, ranges_in, var_count)
}

/// Parity helper for loop summarization using borrowed dispatch inputs.
pub fn loop_summarize_borrowed_via<F>(
    dispatch: &F,
    cfg_in: &[u32],
    ranges_in: &[u32],
    var_count: u32,
) -> Result<Vec<u32>, String>
where
    F: Fn(&vyre::ir::Program, &[&[u8]], Option<[u32; 3]>) -> Result<Vec<Vec<u8>>, String>,
{
    crate::loop_sum::loop_summarize_borrowed_via(dispatch, cfg_in, ranges_in, var_count)
}

/// Reference oracle for may-alias scalar projection.
#[must_use]
#[allow(deprecated)]
pub fn may_alias(pts_p: &[u32], pts_q: &[u32]) -> u32 {
    crate::may_alias::cpu_ref(pts_p, pts_q)
}

/// Reference oracle for range propagation.
#[must_use]
#[allow(deprecated)]
pub fn range_propagate(defs_in: &[u32], edges_in: &[u32], var_count: u32) -> Vec<u32> {
    crate::range::range_propagate_cpu(defs_in, edges_in, var_count)
}

/// Parity helper for range propagation using borrowed dispatch inputs.
pub fn range_propagate_borrowed_via<F>(
    dispatch: &F,
    defs_in: &[u32],
    edges_in: &[u32],
    var_count: u32,
) -> Result<Vec<u32>, String>
where
    F: Fn(&vyre::ir::Program, &[&[u8]], Option<[u32; 3]>) -> Result<Vec<Vec<u8>>, String>,
{
    crate::range::range_propagate_borrowed_via(dispatch, defs_in, edges_in, var_count)
}

/// Parity helper for function summary projection using borrowed dispatch inputs.
pub fn summarize_function_borrowed_via<F>(
    dispatch: &F,
    fn_ast_in: &[u32],
    callgraph_in: &[u32],
    cached_summary_in: &[u32],
    bit_count: u32,
) -> Result<Vec<u32>, String>
where
    F: Fn(&vyre::ir::Program, &[&[u8]], Option<[u32; 3]>) -> Result<Vec<Vec<u8>>, String>,
{
    crate::summary::summarize_function_borrowed_via(
        dispatch,
        fn_ast_in,
        callgraph_in,
        cached_summary_in,
        bit_count,
    )
}

/// Reference oracle for range-bound checking.
#[must_use]
#[allow(deprecated)]
pub fn range_check(interval_hi: &[u32], bound: &[u32]) -> Vec<u32> {
    crate::range_check::cpu_ref(interval_hi, bound)
}

/// Reference oracle for reaching-def summaries.
#[must_use]
#[allow(deprecated)]
pub fn reaching_def_summary(gen_kill_in: &[u32], use_set: &[u32]) -> Vec<u32> {
    crate::reaching_def_summary::cpu_ref(gen_kill_in, use_set)
}

/// Reference oracle for sharded reaching-def summaries.
#[must_use]
#[allow(deprecated)]
pub fn reaching_def_summary_sharded(
    gen_kill_in: &[u32],
    use_set: &[u32],
    shard_count: u32,
) -> Vec<u32> {
    crate::reaching_def_summary::cpu_ref_sharded(gen_kill_in, use_set, shard_count)
}

/// Reference oracle for function summarization.
#[must_use]
#[allow(deprecated)]
pub fn summarize_function(
    ast_summary_in: &[u32],
    callgraph_summary_in: &[u32],
    cached_summary_in: &[u32],
    bit_count: u32,
) -> Vec<u32> {
    crate::summary::summarize_function_cpu(
        ast_summary_in,
        callgraph_summary_in,
        cached_summary_in,
        bit_count,
    )
}