Tilde, My LLVM Alternative
Overall reaction
- Many commenters like seeing a new, smaller alternative to LLVM and hope competition will improve the ecosystem.
- Others are skeptical that a single new project can match LLVM/GCC’s optimization quality and breadth, especially in “a few years.”
Comparisons to existing backends
- Alternatives mentioned: QBE, MIR, PHP’s IR, EigenCompilerSuite, Cwerg, tinycc, various vendor compilers.
- Some prefer small backends (e.g., QBE, MIR, IR) for simplicity and compile speed, though they often lack optimizers or full ABI/ISA coverage.
- A few argue that instead of starting from scratch, contributing optimizers to existing smaller projects might be more realistic.
Performance & optimization debate
- LLVM is criticized as slow and bloated, especially due to many passes.
- Tilde’s author proposes fewer, combined passes to reduce cache churn and phase-ordering issues.
- An experienced compiler engineer strongly challenges this, arguing:
- Those passes exist because combining them while matching LLVM’s performance is very hard.
- Proven-complete global value numbering and similar algorithms are complex, often with poor worst-case complexity.
- Matching LLVM across real-world code would likely take many people and many years, not a single project in a short time.
- Some suggest demonstrating a faster mid-end by acting as a drop-in replacement for LLVM’s
optrather than building a full C toolchain first.
IR design, Sea-of-Nodes, and scheduling
- Tilde uses a Sea-of-Nodes IR. Discussion notes:
- Pros: integrated optimizations, potential for fewer passes.
- Cons: requires a scheduling pass; other projects have moved away due to scheduling cost.
- Suggestions appear to look at SSA-based register allocation and block-argument SSA forms as potential differentiators from LLVM’s “cruft.”
Language, portability, and bootstrapping
- Tilde is in C. Supporters cite:
- C’s ubiquity, easier bootstrapping, fewer dependencies, broad platform support.
- Others dislike C/C++, citing:
- Slow builds, mediocre tooling, poor error messages.
- Calls for Rust, D, Go, or other high-level languages are countered with concerns about dependencies and compile speed.
MLIR and multi-level compilation
- Extended discussion on MLIR:
- It’s a framework for multiple IR “dialects,” not a simple LLVM replacement.
- Some expect more LLVM optimizations/codegen to move into MLIR over time, but this is seen as a long-term, labor-intensive effort.
- Low-level codegen (register allocation, instruction selection) is considered especially hard to replicate.