Which ONE of the following techniques used in compiler code optimization uses live variable analysis?
GATE CSE 2025Compiler Design › Code Optimization & Register AllocationVerified
GATE CSE 2025 PYQ: Which ONE of the following techniques used in compiler code optimization uses live variable analysis?
- ARun-time function call management
- BRegister assignment to variablesCorrect answer
- CStrength reduction
- DConstant folding
Answer
(B) Register assignment to variables
Approach
Live variable analysis determines, for each program point, the set of variables whose current values may still be read before being overwritten. The classic consumers of this information are register allocation (a variable that is live across a point is a candidate to be kept in a register, and liveness pairs define the interference graph) and dead code elimination (an assignment to a variable that is never subsequently live is useless). Of the four listed techniques, only register assignment to variables is driven by liveness information.
Live variable analysis is the standard basis for register allocation (and for dead code elimination). Among the listed optimizations, only assigning registers to variables consumes liveness information, so option B is correct; all three community answers independently converge on B.
Reviewed by GateIQ Editorial Team: IIT & IISc Alumni.