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 This abbreviation has two meanings.
59 Call Frame Information. Used in DWARF debug info and in C++ unwind info
60 to show how the function prolog lays out the stack frame.
63 Control Flow Integrity. A general term for computer security techniques
64 that prevent a wide variety of malware attacks from redirecting the flow
65 of execution (the control flow) of a program.
68 Common Information Entry. A kind of CFI used to reduce the size of FDEs.
69 The compiler creates a CIE which contains the information common across all
70 the FDEs. Each FDE then points to its CIE.
73 Common Subexpression Elimination. An optimization that removes common
74 subexpression computation. For example ``(a+b)*(a+b)`` has two
75 subexpressions that are the same: ``(a+b)``. This optimization would
76 perform the addition only once and then perform the multiply (but only if
77 it's computationally correct/safe).
83 Directed Acyclic Graph
89 A pointer to the interior of an object, such that a garbage collector is
90 unable to use the pointer for reachability analysis. While a derived pointer
91 is live, the corresponding object pointer must be kept in a root, otherwise
92 the collector might free the referenced object. With copying collectors,
93 derived pointers pose an additional hazard that they may be invalidated at
94 any `safe point`_. This term is used in opposition to `object pointer`_.
97 Data Structure Analysis
100 Dead Store Elimination
106 This namespace houses the
107 `Clang Static Analyzer <https://clang.llvm.org/docs/ClangStaticAnalyzer.html>`_.
108 It is an abbreviation of `entomology <https://en.wikipedia.org/wiki/Entomology>`_.
110 *"Entomology is the scientific study of insects."*
112 In the past, this namespace had not only the name `GR` (aka. Graph Reachability)
119 First Class Aggregate
122 Frame Description Entry. A kind of CFI used to describe the stack frame of
129 Garbage Collection. The practice of using reachability analysis instead of
130 explicit memory management to reclaim unused memory.
133 ``GetElementPtr``. An LLVM IR instruction that is used to get the address
134 of a subelement of an aggregate data structure. It is documented in detail
135 `here <https://llvm.org/docs/GetElementPtr.html>`_.
138 Global Value Numbering. GVN is a pass that partitions values computed by a
139 function into congruence classes. Values ending up in the same congruence
140 class are guaranteed to be the same for every execution of the program.
141 In that respect, congruency is a compile-time approximation of equivalence
142 of values at runtime.
150 In garbage collection, the region of memory which is managed using
151 reachability analysis.
157 Internal Compiler Error. This abbreviation is used to describe errors
158 that occur in LLVM or Clang as they are compiling source code. For example,
159 if a valid C++ source program were to trigger an assert in Clang when
160 compiled, that could be referred to as an "ICE".
163 Identical Code Folding
166 Indirect Call Promotion
169 Inter-Procedural Analysis. Refers to any variety of code analysis that
170 occurs between procedures, functions or compilation units (modules).
173 Inter-Procedural Optimization. Refers to any variety of code optimization
174 that occurs between procedures, functions or compilation units (modules).
177 Instruction Selection
183 Loop-Closed Static Single Assignment Form
186 "Looks Good To Me". In a review thread, this indicates that the
187 reviewer thinks that the patch is okay to commit.
190 Loop Invariant Code Motion
193 Language Specific Data Area. C++ "zero cost" unwinding is built on top a
194 generic unwinding mechanism. As the unwinder walks each frame, it calls
195 a "personality" function to do language specific analysis. Each function's
196 FDE points to an optional LSDA which is passed to the personality function.
197 For C++, the LSDA contain info about the type and location of catch
198 statements in that function.
204 Link-Time Optimization
217 "No functional change". Used in a commit message to indicate that a patch
218 is a pure refactoring/cleanup.
219 Usually used in the first line, so it is visible without opening the
228 A pointer to an object such that the garbage collector is able to trace
229 references contained within the object. This term is used in opposition to
236 Profile-Guided Optimization
239 Problem report. A bug filed on `the LLVM Bug Tracking System
240 <https://bugs.llvm.org/enter_bug.cgi>`_.
243 Partial Redundancy Elimination
250 Replace All Uses With. The functions ``User::replaceUsesOfWith()``,
251 ``Value::replaceAllUsesWith()``, and
252 ``Constant::replaceUsesOfWithOnConstant()`` implement the replacement of one
253 Value with another by iterating over its def/use chain and fixing up all of
254 the pointers to point to the new value. See
255 also `def/use chains <ProgrammersManual.html#iterating-over-def-use-use-def-chains>`_.
258 Rearranging associative expressions to promote better redundancy elimination
259 and other optimization. For example, changing ``(A+B-A)`` into ``(B+A-A)``,
260 permitting it to be optimized into ``(B+0)`` then ``(B)``.
263 Request for Comment. An email sent to a project mailing list in order to
264 solicit feedback on a proposed change.
270 In garbage collection, a pointer variable lying outside of the `heap`_ from
271 which the collector begins its reachability analysis. In the context of code
272 generation, "root" almost always refers to a "stack root" --- a local or
273 temporary variable within an executing function.
279 Run-time Type Information
287 In garbage collection, it is necessary to identify `stack roots`_ so that
288 reachability analysis may proceed. It may be infeasible to provide this
289 information for every instruction, so instead the information is
290 calculated only at designated safe points. With a copying collector,
291 `derived pointers`_ must not be retained across safe points and `object
292 pointers`_ must be reloaded from stack roots.
295 Selection DAG Instruction Selection.
298 Strongly Connected Component
301 Sparse Conditional Constant Propagation
304 Superword-Level Parallelism, same as :ref:`Basic-Block Vectorization
305 <lexicon-bb-vectorization>`.
308 Splat refers to a vector of identical scalar elements.
310 The term is based on the PowerPC Altivec instructions that provided
311 this functionality in hardware. For example, "vsplth" and the corresponding
312 software intrinsic "vec_splat()". Examples of other hardware names for this
313 action include "duplicate" (ARM) and "broadcast" (x86).
316 Scalar Replacement of Aggregates
319 Static Single Assignment
322 In garbage collection, metadata emitted by the code generator which
323 identifies `roots`_ within the stack frame of an executing function.
329 Type-Based Alias Analysis
336 Whole Program Devirtualization