Sparse conditional constant propagation
- Sparse conditional constant propagation
In computer science, sparse conditional constant propagation is an optimization frequently applied in compilers after conversion to static single assignment form (SSA). It simultaneously removes dead code and propagates constants throughout a program. It must be noted, however, that it is strictly more powerful than applying dead code elimination and constant propagation in any order or any number of repetitions.Fact|date=July 2008
The algorithm operates by performing abstract interpretation of the code in SSA form. During abstract interpretation, it typically uses a flat lattice of constants for values and a global environment mapping SSA variables to values in this lattice. The crux of the algorithm comes in how it handles the interpretation of branch instructions. When encountered, the condition for a branch is evaluated "as best as possible" given the precision of the abstract values bound to variables in the condition. It may be the case that the values are perfectly precise (neither top nor bottom) and hence, abstract execution can decide in which direction to branch. If the values are not constant, or a variable in the condition is undefined, then both branch directions must be taken to remain conservative.
Upon completion of the abstract interpretation, instructions which were never reached are marked as dead code. SSA variables found to have constant values may then be inlined at--propagated to--their point of use.
References
* Wegman, Mark N. and Zadeck, F. Kenneth. "Constant Propagation with Conditional Branches." "ACM Transactions on Programming Languages and Systems", 13(2), April 1991, pages 181-210.
* Cooper, Keith D. and Torczon, Linda. "Engineering a Compiler". Morgan Kaufmann. 2005.
Wikimedia Foundation.
2010.
Look at other dictionaries:
Constant folding — and constant propagation are related compiler optimizations used by many modern compilers. An advanced form of constant propagation known as sparse conditional constant propagation can more accurately propagate constants and simultaneously remove … Wikipedia
Compiler optimization — is the process of tuning the output of a compiler to minimize or maximize some attributes of an executable computer program. The most common requirement is to minimize the time taken to execute a program; a less common one is to minimize the… … Wikipedia
Свёртка констант — (англ. constant folding) и распространение констант (так же продвижение констант, дублирование констант, англ. constant propagation) часто используемые в современных компиляторах оптимизации, уменьшающие избыточные вычисления,… … Википедия
Static single assignment form — In compiler design, static single assignment form (often abbreviated as SSA form or SSA) is an intermediate representation (IR) in which every variable is assigned exactly once. Existing variables in the original IR are split into versions , new… … Wikipedia
Avr-gcc — GNU Compiler Collection Entwickler: GCC Team Aktuelle Version: 4.4.0 (21. April 2009) … Deutsch Wikipedia
EGCS — GNU Compiler Collection Entwickler: GCC Team Aktuelle Version: 4.4.0 (21. April 2009) … Deutsch Wikipedia
GNU C-Compiler — GNU Compiler Collection Entwickler: GCC Team Aktuelle Version: 4.4.0 (21. April 2009) … Deutsch Wikipedia
GNU C Compiler — GNU Compiler Collection Entwickler: GCC Team Aktuelle Version: 4.4.0 (21. April 2009) … Deutsch Wikipedia
GNU Compiler Collection — Entwickler GCC Team Aktuelle Version 4.6.2 (26. Oktober 2011) Betriebssyste … Deutsch Wikipedia
GNU Compiler Collection — Cc1 redirects here. For other uses of CC1 or CC 1, see CC1 (disambiguation). GNU Compiler Collection Developer(s) GNU Project Initial release May 23, 1987 ( … Wikipedia