[ TOPIC ]
compiler-internals
26 real merged PRs across 4 projects, ordered easiest to hardest. Read them in order to see how compiler-internals shows up in production code, then go deeper with the free papers and talks below.
[ 01 // REAL PRs ]
Next (mid) · 3
fix(compiler-vapor): wrap custom directive value in parens
This PR demonstrates how subtle code generation errors in a compiler can lead to runtime bugs or syntax errors, and how to fix them by correctly handling JavaScript expression syntax.
fix(compiler-vapor): keep the space after a quoted attribute value
This PR demonstrates how small details in code generation and serialization (like whitespace between HTML attributes) can affect standards compliance and interoperability in compilers.
make -Ctarget-feature warnings more explicitly FCWs
This PR demonstrates how to implement and communicate future compatibility warnings in a compiler, showing the process of phasing out previously accepted features.
Go deep (senior) · 23
[mono][wasm][AOT] Pin `OP_MOVE` destinations in the GC pin area
This PR teaches how precise GC root tracking is implemented and debugged in a cross-platform AOT compiler, especially for WebAssembly's unique execution model.
Fix codegen of NotMask on x64
This PR teaches how to fix subtle code generation bugs in a JIT compiler for SIMD mask operations, including how to generalize bit-masking logic, optimize IR transformations, and add targeted regression tests.
Store the names of `Fn` trait parameters in the AST, fix rustfmt bug
This PR demonstrates how to evolve a language's AST and parser to preserve more semantic information (parameter names in Fn traits), coordinating changes across the compiler, tooling, and tests while maintaining backward compatibility.
Make const eval return normalized ty
This PR teaches how to refactor and generalize a core compiler API to handle normalization and error propagation in a type-safe, extensible way, including nuanced error handling and trait system interactions.
target_features: sse (or at least avx2) is incompatible with soft-float ABI
This PR teaches how to proactively handle and lint against unsupported or dangerous target feature combinations in a compiler, including the process of surfacing backend limitations to users with forward compatibility warnings.
Error on projection of dyn noncompat type in old trait solver
This PR teaches how Rust's compiler enforces trait object (dyn Trait) compatibility rules and reports precise errors for invalid trait projections, illustrating deep type system checks and robust error handling in compiler internals.
Allow associated const equality constraints with GCA
This PR teaches how Rust's type system and compiler internals evolve to support new features (generic const arguments) while carefully managing backwards compatibility and trait object constraints.
[LICM] Ignore AA tags on conditional stores in scalar promotion.
This PR teaches how compiler optimizations must carefully handle alias analysis metadata when promoting stores out of loops, especially regarding conditional execution and speculative stores.
volatile: allow accesses to non-AM memory to trap
This PR teaches how to robustly handle undefined behavior and platform differences in volatile memory access by combining documentation, code generation tricks, and careful coordination with backend (LLVM) semantics.
Prefer ambiguous candidates when deduplicating traits in scope, so `ambiguous_glob_imported_traits` doesn't depend on import order
This PR teaches how to make compiler diagnostics order-independent by carefully deduplicating trait candidates and writing robust regression tests for subtle name resolution bugs.
[Clang] Fix "Unions cannot be dynamic classes" assertion
This PR teaches how to robustly handle ill-formed C++ member declarations in a compiler, ensuring error recovery doesn't corrupt class properties or cause crashes, and how to test such edge cases.
Add intrinsics for integer minimum and maximum
Shows how to add efficient integer min/max intrinsics to a compiler backend to improve codegen and optimization.
JIT: update impFixupStructReturnType to handle `GT_RET_EXPR`
This PR demonstrates how to correctly handle struct return types in a JIT compiler by updating IR transformations and adding targeted regression tests.
Fix SIMD primitive zero initialization
This PR demonstrates how subtle bugs in compiler IR transformations can lead to incorrect codegen for SIMD types, and how to write targeted regression tests to catch such issues.
stabilize `c_variadic_naked_functions`
This PR teaches how language features are stabilized in a compiler, including the process of expanding ABI support for naked c-variadic functions and the careful coordination of feature gating, documentation, and backwards compatibility.
point at closure return expression in non-`FnOnce` E0271 errors
This PR teaches how to improve compiler diagnostics by precisely pointing to closure return expressions in trait projection errors, including how to test and reason about such changes.
Enable `-Znext-solver` on nightly by default
This PR teaches how to enable a new compiler feature by default on nightly, while carefully managing configuration, backwards compatibility, and test isolation in a large, complex codebase.
atomic volatile: add intrinsics
This PR teaches how to extend low-level atomic intrinsics with a volatile flag across a compiler and standard library, highlighting the challenges of API evolution, cross-backend support, and the propagation of new semantics through a complex system.
support `#[target_feature(enable = ...)]` on `#[naked]` functions
Demonstrates adding support for target-specific CPU features on naked functions in a compiler backend, including cross-target handling, feature toggling, and integration with inline assembly.
[Clang] Fix a regression introduced by #216729.
This PR teaches how subtle API design choices (constructor overloads) can lead to confusing bugs in compiler internals, and how targeted tests help prevent regressions in complex language features like C++ concepts.
fix supposedly unreachable `bug!` being reachable
This PR teaches how to handle supposedly unreachable states in a type system implementation, including updating error handling and documenting subtle normalization behavior in a compiler's type-checking logic.
[clang][Parse] Stop parsing declarator chunks after a parenthesized structured binding
This PR teaches how to robustly extend a C++ parser to properly handle edge cases in declarator parsing, preventing crashes and ensuring correct diagnostics for invalid structured binding syntax.
remove scalar size mismatch interpreter error, make it an ICE instead
This PR demonstrates how to transition from a recoverable interpreter error to an internal compiler error (ICE) for scalar size mismatches, clarifying error handling boundaries in compiler internals.
[ 02 // MUST-READ PAPERS ]
Free to read, ranked by citations.
- LLVM: A Compilation Framework for Lifelong Program Analysis & TransformationChris Lattner, Vikram Adve · CGO · 20042,974 citationsfree PDF
- Efficiently computing static single assignment form and the control dependence graphRon K. Cytron, Jeanne Ferrante Y, Barry K. Rosen · ACM Transactions on Programming Languages and Systems · 19912,351 citationsfree PDF
- Linear scan register allocationMassimiliano Poletto, Vivek Sarkar · ACM Transactions on Programming Languages and Systems · 1999373 citationsfree PDF
[ 03 // FREE VIDEOS & TALKS ]
Ranked by views.
other topics

