Optimizers make such tactics unnecessary, freeing the developer to write more natural, readable code. Optimization is an analytical process. After being parsed and analyzed, code is examined to extract the maximum amount of information, which can then be used to improve the code while preserving the programmer's original intent. In typical cases, the greater the scope of optimiz ation, the longer a compiler will take to generate code. You can get more information by examining blocks of code and identifying relationships between variables and expressions, although this takes longer.
Global optimization looks at procedures and loops, and takes even more time.
The complexity of the optimization also affects overall code-generation speed. Some optimizations can be used with any processor, while others are tailored to specific chips. Machine-independent optimizations focus on generic code improvements, such as eliminating common subexpressions, making loops more efficient, and getting rid of dead code and uneeded variables. These generic optimization techniques need no knowledge of the hardware. Nearly all industrial-strength compilers today offer a full suite of such optimizations.