7 This document is a work in progress!
16 Aggressive Dead Code Elimination
21 Due to Clang's influence (mostly the fact that parsing and semantic
22 analysis are so intertwined for C and especially C++), the typical
23 working definition of AST in the LLVM community is roughly "the
24 compiler's first complete symbolic (as opposed to textual)
25 representation of an input program".
26 As such, an "AST" might be a more general graph instead of a "tree"
27 (consider the symbolic representation for the type of a typical "linked
28 list node"). This working definition is closer to what some authors
29 call an "annotated abstract syntax tree".
31 Consult your favorite compiler book or search engine for more details.
36 .. _lexicon-bb-vectorization:
39 Basic-Block Vectorization
42 Bit-tracking dead code elimination. Some bit-wise instructions (shifts,
43 ands, ors, etc.) "kill" some of their input bits -- that is, they make it
44 such that those bits can be either zero or one without affecting control or
45 data flow of a program. The BDCE pass removes instructions that only
46 compute these dead bits.
49 Bottom Up Rewriting System --- A method of instruction selection for code
50 generation. An example is the `BURG
51 <http://www.program-transformation.org/Transform/BURG>`_ tool.
57 Call Frame Information. Used in DWARF debug info and in C++ unwind info
58 to show how the function prolog lays out the stack frame.
61 Common Information Entry. A kind of CFI used to reduce the size of FDEs.
62 The compiler creates a CIE which contains the information common across all
63 the FDEs. Each FDE then points to its CIE.
66 Common Subexpression Elimination. An optimization that removes common
67 subexpression compuation. For example ``(a+b)*(a+b)`` has two subexpressions
68 that are the same: ``(a+b)``. This optimization would perform the addition
69 only once and then perform the multiply (but only if it's computationally
76 Directed Acyclic Graph
82 A pointer to the interior of an object, such that a garbage collector is
83 unable to use the pointer for reachability analysis. While a derived pointer
84 is live, the corresponding object pointer must be kept in a root, otherwise
85 the collector might free the referenced object. With copying collectors,
86 derived pointers pose an additional hazard that they may be invalidated at
87 any `safe point`_. This term is used in opposition to `object pointer`_.
90 Data Structure Analysis
93 Dead Store Elimination
102 Frame Description Entry. A kind of CFI used to describe the stack frame of
109 Garbage Collection. The practice of using reachability analysis instead of
110 explicit memory management to reclaim unused memory.
113 ``GetElementPtr``. An LLVM IR instruction that is used to get the address
114 of a subelement of an aggregate data structure. It is documented in detail
115 `here <http://llvm.org/docs/GetElementPtr.html>`_.
118 Global Value Numbering. GVN is a pass that partitions values computed by a
119 function into congruence classes. Values ending up in the same congruence
120 class are guaranteed to be the same for every execution of the program.
121 In that respect, congruency is a compile-time approximation of equivalence
122 of values at runtime.
130 In garbage collection, the region of memory which is managed using
131 reachability analysis.
137 Internal Compiler Error. This abbreviation is used to describe errors
138 that occur in LLVM or Clang as they are compiling source code. For example,
139 if a valid C++ source program were to trigger an assert in Clang when
140 compiled, that could be referred to as an "ICE".
143 Inter-Procedural Analysis. Refers to any variety of code analysis that
144 occurs between procedures, functions or compilation units (modules).
147 Inter-Procedural Optimization. Refers to any variety of code optimization
148 that occurs between procedures, functions or compilation units (modules).
151 Instruction Selection
157 Loop-Closed Static Single Assignment Form
160 "Looks Good To Me". In a review thread, this indicates that the
161 reviewer thinks that the patch is okay to commit.
164 Loop Invariant Code Motion
167 Language Specific Data Area. C++ "zero cost" unwinding is built on top a
168 generic unwinding mechanism. As the unwinder walks each frame, it calls
169 a "personality" function to do language specific analysis. Each function's
170 FDE points to an optional LSDA which is passed to the personality function.
171 For C++, the LSDA contain info about the type and location of catch
172 statements in that function.
178 Link-Time Optimization
191 "No functional change". Used in a commit message to indicate that a patch
192 is a pure refactoring/cleanup.
193 Usually used in the first line, so it is visible without opening the
202 A pointer to an object such that the garbage collector is able to trace
203 references contained within the object. This term is used in opposition to
210 Problem report. A bug filed on `the LLVM Bug Tracking System
211 <https://bugs.llvm.org/enter_bug.cgi>`_.
214 Partial Redundancy Elimination
221 Replace All Uses With. The functions ``User::replaceUsesOfWith()``,
222 ``Value::replaceAllUsesWith()``, and
223 ``Constant::replaceUsesOfWithOnConstant()`` implement the replacement of one
224 Value with another by iterating over its def/use chain and fixing up all of
225 the pointers to point to the new value. See
226 also `def/use chains <ProgrammersManual.html#iterating-over-def-use-use-def-chains>`_.
229 Rearranging associative expressions to promote better redundancy elimination
230 and other optimization. For example, changing ``(A+B-A)`` into ``(B+A-A)``,
231 permitting it to be optimized into ``(B+0)`` then ``(B)``.
237 In garbage collection, a pointer variable lying outside of the `heap`_ from
238 which the collector begins its reachability analysis. In the context of code
239 generation, "root" almost always refers to a "stack root" --- a local or
240 temporary variable within an executing function.
251 In garbage collection, it is necessary to identify `stack roots`_ so that
252 reachability analysis may proceed. It may be infeasible to provide this
253 information for every instruction, so instead the information may is
254 calculated only at designated safe points. With a copying collector,
255 `derived pointers`_ must not be retained across safe points and `object
256 pointers`_ must be reloaded from stack roots.
259 Selection DAG Instruction Selection.
262 Strongly Connected Component
265 Sparse Conditional Constant Propagation
268 Superword-Level Parallelism, same as :ref:`Basic-Block Vectorization
269 <lexicon-bb-vectorization>`.
272 Splat refers to a vector of identical scalar elements.
274 The term is based on the PowerPC Altivec instructions that provided
275 this functionality in hardware. For example, "vsplth" and the corresponding
276 software intrinsic "vec_splat()". Examples of other hardware names for this
277 action include "duplicate" (ARM) and "broadcast" (x86).
280 Scalar Replacement of Aggregates
283 Static Single Assignment
286 In garbage collection, metadata emitted by the code generator which
287 identifies `roots`_ within the stack frame of an executing function.
293 Type-Based Alias Analysis