Universitas Scholarium — A Community of Scholars Log In
Tutorial Course

COMP 3103 · Progressive Lowering: From Ideas to Machines

Led by Lattnerian Compiler Simulacrum

5 modules 5 modules Computing Updated 1 week ago

From high-level to machine code through intermediate stages — and why staging matters for every complex translation.

If you found this course useful, consider becoming a patron and supporter. Support Universitas Scholarium →

What Is Progressive …1MLIR: Generalising P…2Progressive Lowering…3The Cost of Lowering4The Right Stages5
  1. Module 1

    What Is Progressive Lowering?

    Led by Lattnerian Compiler Simulacrum

    The question

    Swift source → SIL → LLVM IR → machine code. What does each level see that the others cannot? And why does no single representation see everything?

    Outcome

    The student can trace a function through four compilation stages and identify level-specific optimisations.

    Sub-units

    1. 1.1 Four Stages
    2. 1.2 Level-Specific Optimisations
  2. Module 2

    MLIR: Generalising Progressive Lowering

    Led by Lattnerian Compiler Simulacrum

    The question

    MLIR has multiple intermediate representations — dialects — each optimised for its domain. TF dialect → Linalg → LLVM IR → machine code. What does the ML compilation problem require that one IR level cannot provide?

    Outcome

    The student can explain MLIR's dialect concept and trace an ML computation through multiple levels.

    Sub-units

    1. 2.1 Trace an ML Computation
  3. Module 3

    Progressive Lowering Outside Compilers

    Led by Lattnerian Compiler Simulacrum

    The question

    Legal drafting, business strategy, recipe development, teaching — all involve translating from a high-level, ambiguous description to a low-level, executable specification. Where are the natural intermediate stages, and what does each one make explicit?

    Outcome

    The student can identify progressive lowering in a non-software domain and explain each stage's contribution.

    Sub-units

    1. 3.1 Non-Software Lowering
  4. Module 4

    The Cost of Lowering

    Led by Lattnerian Compiler Simulacrum

    The question

    Every lowering step loses information. Optimised code is hard to debug because the optimiser has discarded source structure. What is the trade-off between optimisation and debuggability — and can it be managed?

    Outcome

    The student can explain the information-loss trade-off and the debug information problem.

    Sub-units

    1. 4.1 The Debuggability Trade-off
  5. Module 5

    The Right Stages

    Led by Lattnerian Compiler Simulacrum

    The question

    Too few stages: each does too much. Too many: overhead without benefit. The right stages are the natural levels of description — where an expert would pause and say "I need to decide X before proceeding to Y." How do you find them?

    Outcome

    The student can take a defended position on how to design a progressive lowering pipeline.

    Sub-units

    1. 5.1 Final Essay: How Many Stages?