Content deleted Content added
mNo edit summary |
Added a list of related tools, paragraph about post pass optimizations |
||
Line 63:
Today, automated optimizations are almost exclusively limited to compiler optimization. '''Compiler [[optimization]]''' is used to improve the efficiency (in terms of running time or resource usage) of the code output by a [[compiler]]. These techniques allow [[computer programmer|programmers]] to write code in a straightforward manner, expressing their intentions clearly, while allowing the computer to make choices about implementation details that lead to efficient code. Contrary to what the term might imply, this rarely results in code that is perfectly "optimal" by any measure, only code that is much improved compared to direct translation of the programmer's original code.
Further problems with optimizing compilers are:
Usually, the optimizer takes what has been produced by the compiler and replaces it with a better version. In other words, high-level redundancy in the source program (such as an inefficient algorithm) remain unchanged with optimizers. ▼
▲* Usually,
In the early times of computer science, compiler optimizations were not as good as hand-written ones. As compiler technologies have improved, good compilers can often generate better code than human programmers. In the [[RISC]] CPU architecture, compiler optimization is the key for obtaining an optimal code, because the RISC instruction set is so compact that it is hard for a human to manually schedule or combine small instructions to get efficient results.▼
* Modern third-party compilers usually have to support several objectives. In so doing, these compilers are the jack of all trades yet the master of none.
* A compiler can only handle a small part of an application at a time, the result being that it is unable to consider important contextual information. In fact, most optimizations performed by standard compilers are very localized, applying to basic blocks or even single instructions.
This is where so-called "post pass" optimizers come in. These tools take the program code output by an "optimizing" compiler and optimize it even further (see http://www.absint.com/aipop for an example of such tool). As opposed to compilers which optimize intermediate representations of programs, post pass optimizers work on the [[Assembly language]] level.
▲In the early times of computer science, compiler optimizations were not as good as hand-written ones. As compiler technologies have improved, good compilers can often generate better code than human programmers — and good post pass optimizers can improve highly hand-optimized code even further. In the [[RISC]] CPU architecture, compiler optimization is the key for obtaining an optimal code, because the RISC instruction set is so compact that it is hard for a human to manually schedule or combine small instructions to get efficient results.
Techniques in optimization can be broken up along various dimensions:
Line 196 ⟶ 204:
; ''Branch offset optimization (machine independent)'': Choose the shortest branch displacement that reaches target
== Subpages ==
Line 206 ⟶ 211:
* ''Writing Efficient Programs'', Jon Louis Bentley, 1982, ISBN 0139702512.
== Related terms ==
* [[Abstract interpretation]]
* [[Control flow graph]]
* [[SSA form]]
* [[Queueing theory]]
* [[Simulation]]
== Tools ==
* http://www.Program-Analysis.com
* http://www.StackAnalyzer.com
* http://www.AbsInt.com/aipop/
|