Validating more loop optimizations
The purpose of this relaxation is to allow compiler optimization to perform certain kinds of code rearrangement that preserve the semantics of properly synchronized programs. The greater quantity of information extracted means that optimizations can be more effective compared to when they only have access to local information (i.e., within a single function).
E.g.: Instructions which do several things at once, such as decrement register and branch if not zero.
The following is an instance of a local machine dependent optimization.
To set a register to 0, the obvious way is to use the constant '0' in an instruction that sets a register value to a constant.
Some of the techniques that can be applied in a more limited scope, such as macro compression (which saves space by collapsing common sequences of instructions), are more effective when the entire executable task image is available for analysis. Thus similar optimization techniques can be used across languages.
Most high-level languages share common programming constructs and abstractions: decision (if, switch, case), looping (for, while, repeat.. However, certain language features make some kinds of optimizations difficult.Therefore, if a program makes several calls to the same function with the same arguments, the compiler can immediately infer that the function's result need be computed only once.