← 🚀 Code Optimisation & Data-Flow
Subtopic 7 of 7

9.7Data-flow framework at a glance

Each analysis picks a direction (forward/backward), a meet (∪ or ∩), and gen/kill sets per block, then iterates to a fixed point. Initialisation: ∅ for ∪-analyses, universal set for ∩-analyses.

AnalysisDirectionMeetInitial valueUsed for
Reaching definitionsForward∪ (may)∅constant propagation, loop invariants
Live variablesBackward∪ (may)∅dead code, register allocation
Available expressionsForward∩ (must)universal set (entry: ∅)common subexpression elimination
Very busy expressionsBackward∩ (must)universal setcode hoisting

"May" analyses start at ∅ and grow; "must" analyses start at the universal set and shrink.

Previous year questions: Code Optimisation & Data-Flow (3)

PYQs are grouped by topic, so this is the full set for Code Optimisation & Data-Flow; try the ones that match this subtopic. Open all 3 on the topic page.