Skip to content

feat/linear scan register allocator#376

Merged
nahime0 merged 10 commits into
mainfrom
feat/linear-scan-register-allocator
Jun 16, 2026
Merged

feat/linear scan register allocator#376
nahime0 merged 10 commits into
mainfrom
feat/linear-scan-register-allocator

Conversation

@nahime0

@nahime0 nahime0 commented Jun 16, 2026

Copy link
Copy Markdown
Member
  • docs: rewrite eir-06 plan for full linear-scan register allocator
  • feat(ir_passes): implement liveness analysis for EIR functions
  • feat(ir_passes): build linear-order live intervals from liveness
  • feat(ir_passes): linear-scan allocator core with int/float pools and spilling
  • feat(codegen_ir): wire linear-scan allocator into EIR backend behind --regalloc
  • docs: document linear-scan register allocation in the-ir.md
  • fix(ir_passes): restrict x86_64 allocation pool to rbx
  • docs: mark linear-scan register allocator complete in ROADMAP

nahime0 added 10 commits June 16, 2026 10:20
…--regalloc

Default to the linear-scan register allocator with callee-saved preservation;
--regalloc=stack (or ELEPHC_REGALLOC=stack) selects the spill-everything
fallback. Value-access chokepoints become allocation-aware, prologue/epilogue
save and restore used callee-saved registers, and emit_reg_move handles GP<->FP
moves. Full codegen suite passes under both modes on macOS aarch64.
r14/r15 are used as scratch by hand-written x86_64 runtime routines and shared
heap-marker codegen without ABI-compliant save/restore, so values held there
across calls get corrupted (observed as heap exhaustion in spread/variadic
tests). Only rbx is reliably preserved. Full codegen suite now passes on Linux
x86_64, Linux aarch64, and macOS aarch64.
@nahime0
nahime0 merged commit 2fee9a0 into main Jun 16, 2026
19 checks passed
@nahime0
nahime0 deleted the feat/linear-scan-register-allocator branch June 16, 2026 13:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant