![]() ![]() Source codes generally have a number of instructions, which are always executed in sequence and are considered as the basic blocks of the code. Machine-dependent optimizers put efforts to take maximum advantage of memory hierarchy. It involves CPU registers and may have absolute memory references rather than relative references. Machine-dependent optimization is done after the target code has been generated and when the code is transformed according to the target machine architecture. Should not only save the CPU cycles, but can be used on any processor. This code involves repeated assignment of the identifier item, which if we put this way: In this optimization, the compiler takes in the intermediate code and transforms a part of the code that does not involve any CPU registers and/or absolute memory locations. Optimization can be categorized broadly into two types : machine independent and machine dependent. While producing the target machine code, the compiler can make use of memory hierarchy and CPU registers. ![]() ![]() Optimization should itself be fast and should not delay the overall compiling process.Įfforts for an optimized code can be made at various levels of compiling the process.Īt the beginning, users can change/rearrange the code or use better algorithms to write the code.Īfter generating intermediate code, the compiler can modify the intermediate code by address calculations and improving loops. Optimization should increase the speed of the program and if possible, the program should demand less number of resources. The output code must not, in any way, change the meaning of the program. A code optimizing process must follow the three rules given below: In optimization, high-level general programming constructs are replaced by very efficient low-level programming codes. Optimization is a program transformation technique, which tries to improve the code by making it consume less resources (i.e. ![]()
0 Comments
Leave a Reply. |