CS 6120: Advanced Compilers: The Self-Guided Online Course (2020)
CS 6120: Advanced Compilers
The Self-Guided Online Experience (2020 Edition)
Developed by Adrian Sampson, CS 6120 is a Cornell PhD-level computer science course centered on the implementation of programming languages.
The curriculum balances "universal" compiler fundamentals—such as data flow, intermediate representations (IR), and traditional optimizations—with cutting-edge research topics, including garbage collection, just-in-time (JIT) compilation, and parallelization.
🎓 Course Logistics
This version of the course is designed for students attending the University of Your Imagination.
Credit Value: 4 Imagination Credits (Ungraded)
The learning path is a linear sequence of lessons paired with academic papers. Each module typically includes:
- Instructional videos
- Comprehensive written notes
- Practical implementation exercises
These tasks are intentionally open-ended; they are designed to bridge the gap between .
🛠️ Tools of the Trade
Students will engage in open-source hacking using:
LLVM(The industry standard)Bril(A specialized educational IR created specifically for this course)
⚖️ Self-Guided vs. Official Course
While based on the official Cornell offering, there are a few key distinctions:
| Feature | Official CS 6120 | Self-Guided Version |
|---|---|---|
| Deadlines | Strict | |
| Communication | Zulip Discussion Threads | Independent Study |
| Final Project | Semester-end Project | Change the world via compilers |
Note: The instructor admits to being a "video production neophyte," so please overlook the quality of the early recordings.
🗺️ Learning Roadmap
📚 Detailed Curriculum
Phase 1: Foundations
- Lesson 1: Welcome
- Video: Overview
- Reading: "Producing Wrong Data Without Doing Anything Obviously Wrong!"
- Reading: SIGPLAN Empirical Evaluation Guidelines
- Lesson 2: Representing Programs
- Focus: How programs are modeled; getting started with
Bril.
- Focus: How programs are modeled; getting started with
- Lesson 3: Local Analysis Optimization
- Topics: Local Value Numbering, Simple Dead Code Elimination.
Phase 2: Analysis & Optimization
- Lesson 4: Data Flow
- Activity: Implementation task.
- Lesson 5: Global Analysis
- Focus: Global optimization.
- Reading: "Efficient Path Profiling" (Ball & James R.).
- Lesson 6: Static Single Assignment (SSA)
- Reading: "Provably Correct Peephole Optimizations with Alive" (Nuno P.).
Phase 3: The LLVM Ecosystem
- Lesson 7: LLVM
- Focus: Introduction to the framework and authoring an LLVM pass.
- Lesson 8: Loop Optimization
- Resource: Video lecture.
- Lesson 9: Interprocedural Analysis
- Resource: Video lecture.
- Reading: "Type-Based Alias Analysis" (Diwan, et al.).
Phase 4: Memory & Runtime
- Lesson 10: Alias Analysis
- Resource: Video lecture.
- Reading: "A Unified Theory of Garbage Collection" (David F.).
- Reading: "Fast Conservative Garbage Collection" (Shahriyar & Stephen M.).
- Lesson 11: Memory Management
- Resource: Video lecture.
- Reading: "An Efficient Implementation of SELF..." (C. et al.).
- Reading: "Trace-Based Just-in-Time Type Specialization for Dynamic Languages" (Gal, Eich, et al.).
Phase 5: Advanced Topics
- Lesson 12: Dynamic Compilers
- Topics: Tracing via Speculation.
- Reading: "Superoptimizer: A Look at the Smallest Program" (Alexia Massalin).
- Reading: "Chlorophyll: Synthesis-Aided Compiler for Low-Power Spatial Architectures" (Phothilimthana, et al.).
- Lesson 13: Concurrency & Parallelism
- Resource: Video lecture.
- Reading: "Threads Cannot Be Implemented as a Library" (Hans-J.).
- Reading: "Exploiting Superword Level Parallelism with Multimedia Instruction Sets" (Larsen & Amarasinghe).
- Reading: "A Type and Effect System for Deterministic Parallel Java" (Adve, et al.).
🛠️ Contribution & Feedback
Since CS 6120 is open source, you can find the materials on GitHub. If you encounter an error in the code or notes, please submit a bug report.
Final Step: Once you have completed your journey, please provide your thoughts via the feedback form.
# Example: How to start your journey
git clone https://github.com/adriansampson/cs6120.git
cd cs6120
echo "Time to change the world!"