Compiler Design May 2024
Compiler Design May 2024
|''|''|||''|'''|||'|
Code No: R2031421 R20 SET - 1
8. a) Importance of a flow graph? Build a flow graph for the following code. [7M]
i=1; sum=0;
while (i<=10)
{
sum+=i;
i++;
}
b) Categorize the objectives of peephole optimization? Explain the different [7M]
techniques used in peephole optimization.
UNIT-V
9. a) Illustrate the machine dependent code optimization. [7M]
b) Create the three-address code for the following program fragment? [7M]
while (A<C and B>D) do
if A=1 then C=C+1
else
while A<=D do
A=A+B
(OR)
10. a) Demonstratethe register descriptor and address descriptor with examples. [7M]
b) Explain how do you calculate the cost of an instruction? Measure the total cost [7M]
of the following target code.
MOV a, R0
ADD b, R0
MOV C, R0
ADD R0,R1
MOV R1,X
2 of 2
|''|''|||''|'''|||'|