code wiki / _hdl_build / nx_regalloc_calls_test.nx

nx_regalloc_calls_test.nx

buildroot/runtime/_hdl_build/nx_regalloc_calls_test.nx

5970 B110 linesdepth 5pulls 5 transitivereach 0 importersview sourcekind gate/prooftopic regalloc
docsdependenciesstructsconstsfunctions

about

nx_regalloc_calls_test.nx -- PROVE the G1 allocator's live-across-call capability, with the bug reproduced under control. One kernel where v0,v1,v2 are all live across a call: CALL-UNAWARE alloc (base ra_linscan): places a spanning vreg in a caller-saved reg -> ra_validate_calls flags it (STATIC) AND the execution model diverges (DYNAMIC). CALL-AWARE alloc (ra_linscan_calls): spanning vregs are callee-saved or spilled -> validate passes AND execution matches the reference on every input. Known answer: fixed sound + naive unsound + fixed==ref for all inputs -> exit 0.

dependencies 1 imports · 0 importers

nx_regalloc_calls.nx nx_regalloc_calls_test.nx

imports: nx_regalloc_calls.nx

imported by: nobody (leaf or entry point)

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main rt_puts build_kernel ra_compute_last_use ra_linscan sys_mmap ra_linscan_calls rc_spans_call ra_validate_calls rc_spans_call ↻ rt_num rt_puts ↻ run_trials rc_interp_ref ri_op_eval rc_interp_alloc ri_get ri_op_eval ↻ rt_eq tally

structs

none

consts

none

functions

11func rt_puts(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(1, s, n); return 0 }
called by 2: rt_nummain
12func rt_num(v: i64) -> i64
called by 1: main calls 1: rt_puts
21func rt_eq(a: i64, b: i64) -> i64 { if a == b { return 1 } return 0 }
called by 1: main
22func tally(r: *i64, n: i64) -> i64
called by 1: main
30func build_kernel(op: *i64, u0: *i64, u1: *i64, imm: *i64, isc: *i64) -> i64
called by 1: main
42func run_trials(n: i64, nreg: i64, ncaller: i64, op: *i64, u0: *i64, u1: *i64, imm: *i64, isc: *i64,
called by 1: main calls 2: rc_interp_refrc_interp_alloc
60func main() -> i64