Professional Documents
Culture Documents
Assignment 5.4 Ans
Assignment 5.4 Ans
Assignment 5.4 Ans
4 : Peephole Optimization
Apply Peephole Optimization techniques for the following and produce the optimized code.
1.
degug=0
if degug==1 goto L1
goto L2
L2:
2.
X*1 =?
X+1=?
x-1=?
2*x=?
Answers
1.
Goto L2
L2:
2. X*1 = X
X+1 = ++x
x-1 = --x
2*x = x+x