code wiki / _hdl_build / nx_regalloc_calls_test.nx
nx_regalloc_calls_test.nx
buildroot/runtime/_hdl_build/nx_regalloc_calls_test.nx
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
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
structs
| none |
consts
| none |
functions
| 11 | func 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 } |
| 12 | func rt_num(v: i64) -> i64 |
| 21 | func rt_eq(a: i64, b: i64) -> i64 { if a == b { return 1 } return 0 } called by 1: main |
| 22 | func tally(r: *i64, n: i64) -> i64 called by 1: main |
| 30 | func build_kernel(op: *i64, u0: *i64, u1: *i64, imm: *i64, isc: *i64) -> i64 called by 1: main |
| 42 | func run_trials(n: i64, nreg: i64, ncaller: i64, op: *i64, u0: *i64, u1: *i64, imm: *i64, isc: *i64, |
| 60 | func main() -> i64 |