Compiler Design and Optimization
-
Lexical Analysis and Maximal Munch
Tokenize by tracking the longest accepted prefix and resolve ties without breaking identifier boundaries.
-
Predictive Parsing with FIRST and FOLLOW Sets
Compute lookahead choices for nullable grammar alternatives and diagnose why two productions compete for one table entry.
-
LR Items and Shift–Reduce Parsing
Interpret a dotted production as progress through a rule and trace the parser’s choice to shift or reduce.
-
Parser Recovery at Syntactic Boundaries
Resume after a malformed statement by recovering at a token valid in the enclosing context and limit cascaded diagnostics.
-
Basic Blocks and Control-Flow Graphs
Build a control-flow graph from jump boundaries and state which exceptional exits are part of the program model.
-
Dominators and Dominator Trees
Compute which blocks every path to a program point must traverse and use immediate dominators to organize that relation.
-
SSA Phi Functions at Control-Flow Joins
Read a phi input on the predecessor edge that selected it and translate parallel phi assignments without overwriting needed values.
-
Reaching Definitions as Forward Dataflow
Identify which assignments can supply a later read and use the difference between generating and killing definitions at each statement.
-
Live Variables and Backward Dataflow
Determine which current values can still be read and use the answer to separate dead assignments from necessary ones.
-
Constant Propagation and Merging Values
Use a lattice of facts to represent a known constant, absent information from an unreachable path, and genuine disagreement.
-
Sparse Conditional Constant Propagation
Combine executable-edge discovery with SSA value facts so impossible branches do not spoil a constant at a merge.
-
Dead Assignments and Observable Effects
Delete a computation only when its result and its evaluation are both outside the program’s observable behavior.
-
Value Numbering and Common Subexpressions
Recognize two computations with the same value and check that a reusable definition dominates the second use.
-
Loop-Invariant Code Motion and Safe Hoisting
Move a computation to a loop preheader only after proving its operands stay stable and that earlier evaluation is legal.
-
Strength Reduction for Induction Variables
Replace a repeated affine computation by updates to a derived induction variable and check that the arithmetic semantics agree.
-
May-Alias and Must-Alias in Compiler Analysis
Separate possible overlap from guaranteed identity and use each answer only for the transformations it justifies.
-
Register Allocation, Interference, and Spilling
Convert overlapping live ranges into register constraints and see how spilling changes both code cost and liveness.
-
Calling Conventions and Live Values Across Calls
Track the caller’s and callee’s register obligations and relate those contracts to compiler allocation choices.
-
Instruction Selection by Tree Covering
Cover intermediate expressions with target patterns and compare legal alternatives by cost without changing arithmetic semantics.
-
Compiling Pattern Matches into Decision Trees
Share tests for constructors while preserving the first matching clause and the order of effectful guards.