Friday, June 15, 2012

Code optimization


 Code optimization phase improve the intermediate code ie., It reduces the code by removing the repeated or unwanted instructions from the intermediate code. The above giving intermediate code can be optimized to the following
                             Temp1:=id3+60.o                            
                             id1:=id2+temp1
compiler can deduce that the conversion of 60 from integer to real can be done all at
once at compile time. So that into real operations can be eliminated.temp3is used to
transmit its value to id1 instead which can be directly substituted to id1.

0 comments:

Post a Comment