Filter by year

Local Optimization questions

Q42

GATE CS 2026 CS-1Optimization and Data FlowMCQ2 marks−2/3 if wrong
Consider the control flow graph shown in the figure.

Which one of the following options correctly lists the set of redundant expressions (common subexpressions) in the basic blocks B4 and B5?

Note: All the variables are integers.
Question figure
Show answer without attempting

Answer: D

Q34

GATE CS 2014 CS-3Optimization and Data FlowMCQ2 marks−2/3 if wrong
Consider the basic block given below.

a = b + c
c = a + d
d = b + c
e = d - b
a = e + b

The minimum number of nodes and edges present in the DAG representation of the above basic block respectively are
Show answer without attempting

Answer: A

Q17

GATE CS 2014 CS-1Optimization and Data FlowMCQ1 mark−1/3 if wrong
Which one of the following is FALSE?
Show answer without attempting

Answer: D

Q48

GATE CS 2013 CSOptimization and Data FlowMCQ2 marks−2/3 if wrong
Suppose the instruction set architecture of the processor has only two registers. The only allowed compiler optimization is code motion, which moves statements from one place to another while preserving correctness. What is the minimum number of spills to memory in the compiled code?
Show answer without attempting

Answer: B

Q49

GATE CS 2013 CSOptimization and Data FlowMCQ2 marks−2/3 if wrong
What is the minimum number of registers needed in the instruction set architecture of the processor to compile this code segment without any spill to memory? Do not apply any optimization other than optimizing register allocation.
Show answer without attempting

Answer: B

0/50 correct0 marks

Related topics in Optimization and Data Flow