Rationale

Why yet another 6502 C compiler?
After all, there's cc65, and KickC, and vbcc, and plenty of other efforts out there to target the 6502. And the processor is ancient anyway. So why bother porting LLVM to it?

Performance
Even at this early date, llvm-mos can find codegen optimizations that seem almost magical to mortal eyes.

By giving codegen control over a chunk of zero page memory, llvm-mos can treat that memory as imaginary registers for codegen purposes.

This makes the majority of emitted code into two-byte 6502 instructions, which are generally around a third faster, and a third smaller, than their three-byte counterparts.

Previously, it was thought that performant code in C on the 6502 was impossible, because all 6502 programs required a C-style soft stack. llvm-mos's greedy register allocator makes it so that many 6502 programs use no 16-bit stack whatsoever. Instead, these programs use zero-page with near-ideal allocation.

llvm-mos's lane-tracking register allocator is obsessive about limiting live variables to zero page, and generally does a better job on large programs than any human might.

And llvm-mos's IndexIV pass lowers most pointer-plus-offset calculations -- generally a performance killer for any C compiler -- into a single native instruction on the 6502.

llvm-mos's link-time optimization pass can remove dead code and perform interprocedural optimization at a level previously impossible for the 6502.

Even though this project is still very early, thanks to the GlobalISel architecture, llvm-mos knows more codegen optimization tricks than any existing 6502 compiler. This added performance will enable new applications and games for the 6502, which were previously impossible to build.

Features
Because this is a subproject of LLVM, it inherits all the features of LLVM. Namely, this project provides full ELF support for 6502 objects, libraries, and executables. This opens up previously impossible functionality, such as viewing 6502 program properties in ELF tools that don't know anything about the 6502 specifically.

llvm-mos is not limited to C. It also provides a fully functional assembler and disassembler that reads and writes assembly source files in a GNU assembler compatible format. This in turns opens up a world of macro programming functionality, for those who prefer to work at the metal level.

A proof of concept exists, demonstrating that llvm-mos can support Rust as a source language. This suggests that LLVM-MOS can support other source languages as well, such as C++.

Lastly, the llvm-mos project is entirely open source, and developed entirely consistently with LLVM coding standards in mind. Want to experiment with a new codegen pass, or adding a new target? Jump right in, clone the codebase, and start playing.