code wiki / (root) / nx_regalloc_liveness_diag.nx

nx_regalloc_liveness_diag.nx

buildroot/runtime/nx_regalloc_liveness_diag.nx

4147 B99 linesdepth 5pulls 6 transitivereach 0 importersview sourcekind tooltopic regalloc
docsdependenciesstructsconstsfunctions

about

nx_regalloc_liveness_diag.nx -- BITS-UP DIAGNOSTIC for the disabled compute_liveness. Builds the exact CFG shape build_intervals under- approximates: a value defined in the entry, USED in a loop HEADER, and NOT used after the loop. The back-edge (body -> header) makes the value live across the body, but its last LINEAR use is in the header (which precedes the body in block order), so build_intervals' def-to-last-use range stops too early -> linear-scan would think the register is free in the body -> clobber. compute_liveness must extend the interval across the body. This test EXECUTES the allocator (does not execute the built IR); it isolates the correctness question with ZERO blast radius to the self-hosting backend. Exit 0 = both facts confirmed (build_intervals too short; compute_liveness correct). Nonzero = where it diverged (see codes). license_tier: ORIGINAL

dependencies 4 imports · 0 importers

nx_syscalls.nx nx_types.nx nx_ir.nx nx_regalloc.nx nx_regalloc_liveness_diag.nx

imports: nx_syscalls.nxnx_types.nxnx_ir.nxnx_regalloc.nx

imported by: nobody (leaf or entry point)

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

main sys_mmap ir_function_new sys_mmap ↻ ir_type_i64 alloc_type sys_mmap ↻ ir_block_new nx_assert_ptr sys_write nx_puts_err sys_write ↻ nx_assert sys_write ↻ nx_puts_err ↻ nx_assert_lt sys_write ↻ nx_puti_err sys_mmap ↻ sys_write ↻ nx_puts_err ↻ ir_emit_binop nx_assert_ptr ↻ nx_assert ↻ alloc_instr nx_assert_ptr ↻ nx_assert ↻ nx_assert_lt ↻ alloc_value nx_assert_ptr ↻ nx_assert ↻ nx_assert_lt ↻ append_instr ir_const_i64 nx_assert_ptr ↻ nx_assert ↻ alloc_value ↻ ir_type_i64 ↻ ir_emit_br ir_bb_sealed

structs

none

consts

21const K_MAGIC_4096: i64 = 4096

functions

23func main() -> i64