1 Qs · 2013 · 2 marks · 0.1 marks/paperStandard yield
In Code Generation, GATE tests machine-level resource management, specifically register allocation and the minimum number of registers required to evaluate a code block without mem… Guide
Topic guide
In Code Generation, GATE tests machine-level resource management, specifically register allocation and the minimum number of registers required to evaluate a code block without memory spilling. Questions evaluate students on identifying live ranges of variables across basic blocks and control-flow branches under explicit instruction set architecture (ISA) constraints.
Minimum Register Allocation without Spilling
rare · MCQ · 2 marks · 2013
Given a straight-line or simple branching code snippet, determine the minimum number of CPU registers required to execute the snippet without spilling any variables to memory, based on live variable analysis at each program point.
Minimum Registers without Spilling
Used to find the minimum number of machine registers required to execute a sequence of instructions without saving/restoring (spilling) variables to memory when register re-use is allowed.
Tested via a 2-mark question focusing on live variable analysis and register allocation without spilling in an explicit register-only ISA with simple branching.
2013
Medium questions present a straight-line or simple if-else segment with 5–8 instructions where students compute the intersection of live ranges step-by-step. Harder variations could involve loops or complex DAG-based register evaluation trees (e.g., Ershov numbers / Sethi-Ullman algorithm).