What optimizations are present in OCG compilers?
The optimizations in OCG compiler can broadly be broadly grouped into: 1) C-level optimizations — which are performed on the source code before conversion into assembly; and 2) Assembly-level optimizations — which are performed on the assembly code generated by the compiler Of the C-level optimizations, these can be considered as those that: a) Simplify or change the C expressions; and b) Allocate variables to registers An example of where the code expression may be simplified is this: Consider if the original C code read: a = b + c; but the compiler is able to determine that the variable “c” at this point will always hold the value 5. The code expression is essentially changed so that it reads: a = b + 5; This may result in more efficient code after it is built by the compiler. These sorts of optimizations are inherent in the compilation process and currently cannot be disabled. They may reduce both code and data size. Allocation of variables to registers is done after analysing the