Skip to content

For loops with symbolic values: SSA threading across iterations #59

Description

@FrancoGiachetta

Problem

For loops currently cannot handle symbolic values that are reassigned across iterations.

Symbolic values use pure SSA — assign_local only updates a Rust-side Vec, but the MLIR back-edge (cf::br with empty args &[]) has no mechanism to carry the updated SSA value from the end of one iteration to the start of the next.

Example that should work

df main() i32 {
    sym x: expr<i32>;
    let e: expr<i32> = x;
    for i in 0..10 {
        e = e + 1;
    }
    return eval(e, x, 0);
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions