Computer Sciences > GATE 2025 SET-1 > Code Optimization
Which ONE of the following techniques used in compiler code optimization uses live variable analysis?
A
Run-time function call management
B
Register assignment to variables
C
Strength reduction
D
Constant folding

Correct : b

A) Run-time function call management — This involves managing function calls at runtime and does not use live variable analysis.

B) Register assignment to variables — This uses live variable analysis to determine which variables are live at different program points, helping the compiler decide which variables should be allocated to registers and for how long. This is the primary application of live variable analysis.

C) Strength reduction — This optimization replaces expensive operations with cheaper ones (like replacing multiplication by 2 with left shift) and does not require live variable analysis.

D) Constant folding — This optimization evaluates constant expressions at compile time and does not use live variable analysis.

✅ Final Answer: Option (B) — Register assignment to variables.

Reason: Live variable analysis determines which variables are "live" at each program point, which is essential for efficient register allocation and assignment to minimize memory access and optimize performance.

Similar Questions

Consider the following control flow graph: Which one of the following options correctly lists the set of redundant expressions (common subexpressions) i...
#1492 MCQ
A palindrome is a word that reads the same forwards and backwards. In a game of words, a player has the following two plates painted with letters. From...
#1 MCQ
Which number does not belong in the series below? 2, 5, 10, 17, 26, 37, 50, 64
#4 MCQ

Related Topics

No tags found

Unique Visitor Count

Total Unique Visitors

Loading......