Skip to content

Added experimental register allocator (behind -ra flag) - #2

Open
vhelin wants to merge 19 commits into
masterfrom
register-allocator
Open

Added experimental register allocator (behind -ra flag)#2
vhelin wants to merge 19 commits into
masterfrom
register-allocator

Conversation

@vhelin

@vhelin vhelin commented Sep 12, 2026

Copy link
Copy Markdown
Owner

No description provided.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Join-spill generation currently fails before spill offsets exist, and additional build, path-selection, and documentation issues remain.

Get a fresh assessment by requesting another Copilot review.

Pull request overview

Adds an experimental Z80 register allocator behind -ra, including spill handling, build integration, documentation, and extensive SMS regression coverage.

Changes:

  • Implements register allocation, target policies, spills, reloads, and allocator CLI flags.
  • Adds broad byte-level and diagnostic allocator tests.
  • Updates build projects and test-runner path handling.
File summaries
File Description
compiler/{register_allocator,z80_register_spill}.{c,h} Implements allocator core and Z80 spill support.
compiler/{main,pass_4,pass_5,pass_6_z80,il,tac}.{c,h} Integrates allocation into compilation and code generation.
compiler/{CMakeLists.txt,smakefile} Adds allocator sources to builds.
windows/Compiler/Compiler.vcxproj* Adds allocator files to Visual Studio.
tests/z80/sms/allocator_*/{makefile,main.ssc} Adds allocator regression and byte-output tests.
tests/z80/sms/{calculations-1,calculations-2,move_sprite,change_colors}/* Exercises allocator behavior in larger programs.
run_tests.sh Expands binary-path discovery.
.gitignore Tracks test makefiles.
README.md Documents the experimental feature.
Review details
  • Files reviewed: 294/406 changed files
  • Comments generated: 3
  • Review effort level: Balanced

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread compiler/smakefile
Comment thread run_tests.sh Outdated
Comment thread README.md Outdated

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

The extensive compiler backend, control-flow, spilling, and generated-code changes require final human validation across supported build environments.

Review details
  • Files reviewed: 293/407 changed files
  • Comments generated: 0 new
  • Review effort level: Balanced

vhelin and others added 15 commits September 12, 2026 21:50
Co-authored-by: Cursor <cursoragent@cursor.com>

# Conflicts:
#	README.md
#	run_tests_with_sanitizers.sh
Co-authored-by: Cursor <cursoragent@cursor.com>
…ns, and keep multi-latch loops ambiguous.

Restore the run_tests.sh execute bit and force LF on nameless test makefiles so Windows checkouts stay executable and Unix-text.

Co-authored-by: Cursor <cursoragent@cursor.com>
CFG fallthrough after asm now reaches those writes; treating them like ineligible reads dropped the ARRAY_WRITE reload and failed every pipeline on allocator_ra_struct_pointer_increment.

Co-authored-by: Cursor <cursoragent@cursor.com>
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.

2 participants