xref: /aosp_15_r20/external/llvm/docs/Lexicon.rst (revision 9880d6810fe72a1726cb53787c6711e909410d58)
1*9880d681SAndroid Build Coastguard Worker================
2*9880d681SAndroid Build Coastguard WorkerThe LLVM Lexicon
3*9880d681SAndroid Build Coastguard Worker================
4*9880d681SAndroid Build Coastguard Worker
5*9880d681SAndroid Build Coastguard Worker.. note::
6*9880d681SAndroid Build Coastguard Worker
7*9880d681SAndroid Build Coastguard Worker    This document is a work in progress!
8*9880d681SAndroid Build Coastguard Worker
9*9880d681SAndroid Build Coastguard WorkerDefinitions
10*9880d681SAndroid Build Coastguard Worker===========
11*9880d681SAndroid Build Coastguard Worker
12*9880d681SAndroid Build Coastguard WorkerA
13*9880d681SAndroid Build Coastguard Worker-
14*9880d681SAndroid Build Coastguard Worker
15*9880d681SAndroid Build Coastguard Worker**ADCE**
16*9880d681SAndroid Build Coastguard Worker    Aggressive Dead Code Elimination
17*9880d681SAndroid Build Coastguard Worker
18*9880d681SAndroid Build Coastguard Worker**AST**
19*9880d681SAndroid Build Coastguard Worker    Abstract Syntax Tree.
20*9880d681SAndroid Build Coastguard Worker
21*9880d681SAndroid Build Coastguard Worker    Due to Clang's influence (mostly the fact that parsing and semantic
22*9880d681SAndroid Build Coastguard Worker    analysis are so intertwined for C and especially C++), the typical
23*9880d681SAndroid Build Coastguard Worker    working definition of AST in the LLVM community is roughly "the
24*9880d681SAndroid Build Coastguard Worker    compiler's first complete symbolic (as opposed to textual)
25*9880d681SAndroid Build Coastguard Worker    representation of an input program".
26*9880d681SAndroid Build Coastguard Worker    As such, an "AST" might be a more general graph instead of a "tree"
27*9880d681SAndroid Build Coastguard Worker    (consider the symbolic representation for the type of a typical "linked
28*9880d681SAndroid Build Coastguard Worker    list node"). This working definition is closer to what some authors
29*9880d681SAndroid Build Coastguard Worker    call an "annotated abstract syntax tree".
30*9880d681SAndroid Build Coastguard Worker
31*9880d681SAndroid Build Coastguard Worker    Consult your favorite compiler book or search engine for more details.
32*9880d681SAndroid Build Coastguard Worker
33*9880d681SAndroid Build Coastguard WorkerB
34*9880d681SAndroid Build Coastguard Worker-
35*9880d681SAndroid Build Coastguard Worker
36*9880d681SAndroid Build Coastguard Worker.. _lexicon-bb-vectorization:
37*9880d681SAndroid Build Coastguard Worker
38*9880d681SAndroid Build Coastguard Worker**BB Vectorization**
39*9880d681SAndroid Build Coastguard Worker    Basic-Block Vectorization
40*9880d681SAndroid Build Coastguard Worker
41*9880d681SAndroid Build Coastguard Worker**BURS**
42*9880d681SAndroid Build Coastguard Worker    Bottom Up Rewriting System --- A method of instruction selection for code
43*9880d681SAndroid Build Coastguard Worker    generation.  An example is the `BURG
44*9880d681SAndroid Build Coastguard Worker    <http://www.program-transformation.org/Transform/BURG>`_ tool.
45*9880d681SAndroid Build Coastguard Worker
46*9880d681SAndroid Build Coastguard WorkerC
47*9880d681SAndroid Build Coastguard Worker-
48*9880d681SAndroid Build Coastguard Worker
49*9880d681SAndroid Build Coastguard Worker**CFI**
50*9880d681SAndroid Build Coastguard Worker    Call Frame Information. Used in DWARF debug info and in C++ unwind info
51*9880d681SAndroid Build Coastguard Worker    to show how the function prolog lays out the stack frame.
52*9880d681SAndroid Build Coastguard Worker
53*9880d681SAndroid Build Coastguard Worker**CIE**
54*9880d681SAndroid Build Coastguard Worker    Common Information Entry.  A kind of CFI used to reduce the size of FDEs.
55*9880d681SAndroid Build Coastguard Worker    The compiler creates a CIE which contains the information common across all
56*9880d681SAndroid Build Coastguard Worker    the FDEs.  Each FDE then points to its CIE.
57*9880d681SAndroid Build Coastguard Worker
58*9880d681SAndroid Build Coastguard Worker**CSE**
59*9880d681SAndroid Build Coastguard Worker    Common Subexpression Elimination. An optimization that removes common
60*9880d681SAndroid Build Coastguard Worker    subexpression compuation. For example ``(a+b)*(a+b)`` has two subexpressions
61*9880d681SAndroid Build Coastguard Worker    that are the same: ``(a+b)``. This optimization would perform the addition
62*9880d681SAndroid Build Coastguard Worker    only once and then perform the multiply (but only if it's computationally
63*9880d681SAndroid Build Coastguard Worker    correct/safe).
64*9880d681SAndroid Build Coastguard Worker
65*9880d681SAndroid Build Coastguard WorkerD
66*9880d681SAndroid Build Coastguard Worker-
67*9880d681SAndroid Build Coastguard Worker
68*9880d681SAndroid Build Coastguard Worker**DAG**
69*9880d681SAndroid Build Coastguard Worker    Directed Acyclic Graph
70*9880d681SAndroid Build Coastguard Worker
71*9880d681SAndroid Build Coastguard Worker.. _derived pointer:
72*9880d681SAndroid Build Coastguard Worker.. _derived pointers:
73*9880d681SAndroid Build Coastguard Worker
74*9880d681SAndroid Build Coastguard Worker**Derived Pointer**
75*9880d681SAndroid Build Coastguard Worker    A pointer to the interior of an object, such that a garbage collector is
76*9880d681SAndroid Build Coastguard Worker    unable to use the pointer for reachability analysis. While a derived pointer
77*9880d681SAndroid Build Coastguard Worker    is live, the corresponding object pointer must be kept in a root, otherwise
78*9880d681SAndroid Build Coastguard Worker    the collector might free the referenced object. With copying collectors,
79*9880d681SAndroid Build Coastguard Worker    derived pointers pose an additional hazard that they may be invalidated at
80*9880d681SAndroid Build Coastguard Worker    any `safe point`_. This term is used in opposition to `object pointer`_.
81*9880d681SAndroid Build Coastguard Worker
82*9880d681SAndroid Build Coastguard Worker**DSA**
83*9880d681SAndroid Build Coastguard Worker    Data Structure Analysis
84*9880d681SAndroid Build Coastguard Worker
85*9880d681SAndroid Build Coastguard Worker**DSE**
86*9880d681SAndroid Build Coastguard Worker    Dead Store Elimination
87*9880d681SAndroid Build Coastguard Worker
88*9880d681SAndroid Build Coastguard WorkerF
89*9880d681SAndroid Build Coastguard Worker-
90*9880d681SAndroid Build Coastguard Worker
91*9880d681SAndroid Build Coastguard Worker**FCA**
92*9880d681SAndroid Build Coastguard Worker    First Class Aggregate
93*9880d681SAndroid Build Coastguard Worker
94*9880d681SAndroid Build Coastguard Worker**FDE**
95*9880d681SAndroid Build Coastguard Worker    Frame Description Entry. A kind of CFI used to describe the stack frame of
96*9880d681SAndroid Build Coastguard Worker    one function.
97*9880d681SAndroid Build Coastguard Worker
98*9880d681SAndroid Build Coastguard WorkerG
99*9880d681SAndroid Build Coastguard Worker-
100*9880d681SAndroid Build Coastguard Worker
101*9880d681SAndroid Build Coastguard Worker**GC**
102*9880d681SAndroid Build Coastguard Worker    Garbage Collection. The practice of using reachability analysis instead of
103*9880d681SAndroid Build Coastguard Worker    explicit memory management to reclaim unused memory.
104*9880d681SAndroid Build Coastguard Worker
105*9880d681SAndroid Build Coastguard WorkerH
106*9880d681SAndroid Build Coastguard Worker-
107*9880d681SAndroid Build Coastguard Worker
108*9880d681SAndroid Build Coastguard Worker.. _heap:
109*9880d681SAndroid Build Coastguard Worker
110*9880d681SAndroid Build Coastguard Worker**Heap**
111*9880d681SAndroid Build Coastguard Worker    In garbage collection, the region of memory which is managed using
112*9880d681SAndroid Build Coastguard Worker    reachability analysis.
113*9880d681SAndroid Build Coastguard Worker
114*9880d681SAndroid Build Coastguard WorkerI
115*9880d681SAndroid Build Coastguard Worker-
116*9880d681SAndroid Build Coastguard Worker
117*9880d681SAndroid Build Coastguard Worker**IPA**
118*9880d681SAndroid Build Coastguard Worker    Inter-Procedural Analysis. Refers to any variety of code analysis that
119*9880d681SAndroid Build Coastguard Worker    occurs between procedures, functions or compilation units (modules).
120*9880d681SAndroid Build Coastguard Worker
121*9880d681SAndroid Build Coastguard Worker**IPO**
122*9880d681SAndroid Build Coastguard Worker    Inter-Procedural Optimization. Refers to any variety of code optimization
123*9880d681SAndroid Build Coastguard Worker    that occurs between procedures, functions or compilation units (modules).
124*9880d681SAndroid Build Coastguard Worker
125*9880d681SAndroid Build Coastguard Worker**ISel**
126*9880d681SAndroid Build Coastguard Worker    Instruction Selection
127*9880d681SAndroid Build Coastguard Worker
128*9880d681SAndroid Build Coastguard WorkerL
129*9880d681SAndroid Build Coastguard Worker-
130*9880d681SAndroid Build Coastguard Worker
131*9880d681SAndroid Build Coastguard Worker**LCSSA**
132*9880d681SAndroid Build Coastguard Worker    Loop-Closed Static Single Assignment Form
133*9880d681SAndroid Build Coastguard Worker
134*9880d681SAndroid Build Coastguard Worker**LGTM**
135*9880d681SAndroid Build Coastguard Worker    "Looks Good To Me". In a review thread, this indicates that the
136*9880d681SAndroid Build Coastguard Worker    reviewer thinks that the patch is okay to commit.
137*9880d681SAndroid Build Coastguard Worker
138*9880d681SAndroid Build Coastguard Worker**LICM**
139*9880d681SAndroid Build Coastguard Worker    Loop Invariant Code Motion
140*9880d681SAndroid Build Coastguard Worker
141*9880d681SAndroid Build Coastguard Worker**LSDA**
142*9880d681SAndroid Build Coastguard Worker    Language Specific Data Area.  C++ "zero cost" unwinding is built on top a
143*9880d681SAndroid Build Coastguard Worker    generic unwinding mechanism.  As the unwinder walks each frame, it calls
144*9880d681SAndroid Build Coastguard Worker    a "personality" function to do language specific analysis.  Each function's
145*9880d681SAndroid Build Coastguard Worker    FDE points to an optional LSDA which is passed to the personality function.
146*9880d681SAndroid Build Coastguard Worker    For C++, the LSDA contain info about the type and location of catch
147*9880d681SAndroid Build Coastguard Worker    statements in that function.
148*9880d681SAndroid Build Coastguard Worker
149*9880d681SAndroid Build Coastguard Worker**Load-VN**
150*9880d681SAndroid Build Coastguard Worker    Load Value Numbering
151*9880d681SAndroid Build Coastguard Worker
152*9880d681SAndroid Build Coastguard Worker**LTO**
153*9880d681SAndroid Build Coastguard Worker    Link-Time Optimization
154*9880d681SAndroid Build Coastguard Worker
155*9880d681SAndroid Build Coastguard WorkerM
156*9880d681SAndroid Build Coastguard Worker-
157*9880d681SAndroid Build Coastguard Worker
158*9880d681SAndroid Build Coastguard Worker**MC**
159*9880d681SAndroid Build Coastguard Worker    Machine Code
160*9880d681SAndroid Build Coastguard Worker
161*9880d681SAndroid Build Coastguard WorkerN
162*9880d681SAndroid Build Coastguard Worker-
163*9880d681SAndroid Build Coastguard Worker
164*9880d681SAndroid Build Coastguard Worker**NFC**
165*9880d681SAndroid Build Coastguard Worker  "No functional change". Used in a commit message to indicate that a patch
166*9880d681SAndroid Build Coastguard Worker  is a pure refactoring/cleanup.
167*9880d681SAndroid Build Coastguard Worker  Usually used in the first line, so it is visible without opening the
168*9880d681SAndroid Build Coastguard Worker  actual commit email.
169*9880d681SAndroid Build Coastguard Worker
170*9880d681SAndroid Build Coastguard WorkerO
171*9880d681SAndroid Build Coastguard Worker-
172*9880d681SAndroid Build Coastguard Worker.. _object pointer:
173*9880d681SAndroid Build Coastguard Worker.. _object pointers:
174*9880d681SAndroid Build Coastguard Worker
175*9880d681SAndroid Build Coastguard Worker**Object Pointer**
176*9880d681SAndroid Build Coastguard Worker    A pointer to an object such that the garbage collector is able to trace
177*9880d681SAndroid Build Coastguard Worker    references contained within the object. This term is used in opposition to
178*9880d681SAndroid Build Coastguard Worker    `derived pointer`_.
179*9880d681SAndroid Build Coastguard Worker
180*9880d681SAndroid Build Coastguard WorkerP
181*9880d681SAndroid Build Coastguard Worker-
182*9880d681SAndroid Build Coastguard Worker
183*9880d681SAndroid Build Coastguard Worker**PRE**
184*9880d681SAndroid Build Coastguard Worker    Partial Redundancy Elimination
185*9880d681SAndroid Build Coastguard Worker
186*9880d681SAndroid Build Coastguard WorkerR
187*9880d681SAndroid Build Coastguard Worker-
188*9880d681SAndroid Build Coastguard Worker
189*9880d681SAndroid Build Coastguard Worker**RAUW**
190*9880d681SAndroid Build Coastguard Worker
191*9880d681SAndroid Build Coastguard Worker    Replace All Uses With. The functions ``User::replaceUsesOfWith()``,
192*9880d681SAndroid Build Coastguard Worker    ``Value::replaceAllUsesWith()``, and
193*9880d681SAndroid Build Coastguard Worker    ``Constant::replaceUsesOfWithOnConstant()`` implement the replacement of one
194*9880d681SAndroid Build Coastguard Worker    Value with another by iterating over its def/use chain and fixing up all of
195*9880d681SAndroid Build Coastguard Worker    the pointers to point to the new value.  See
196*9880d681SAndroid Build Coastguard Worker    also `def/use chains <ProgrammersManual.html#iterating-over-def-use-use-def-chains>`_.
197*9880d681SAndroid Build Coastguard Worker
198*9880d681SAndroid Build Coastguard Worker**Reassociation**
199*9880d681SAndroid Build Coastguard Worker    Rearranging associative expressions to promote better redundancy elimination
200*9880d681SAndroid Build Coastguard Worker    and other optimization.  For example, changing ``(A+B-A)`` into ``(B+A-A)``,
201*9880d681SAndroid Build Coastguard Worker    permitting it to be optimized into ``(B+0)`` then ``(B)``.
202*9880d681SAndroid Build Coastguard Worker
203*9880d681SAndroid Build Coastguard Worker.. _roots:
204*9880d681SAndroid Build Coastguard Worker.. _stack roots:
205*9880d681SAndroid Build Coastguard Worker
206*9880d681SAndroid Build Coastguard Worker**Root**
207*9880d681SAndroid Build Coastguard Worker    In garbage collection, a pointer variable lying outside of the `heap`_ from
208*9880d681SAndroid Build Coastguard Worker    which the collector begins its reachability analysis. In the context of code
209*9880d681SAndroid Build Coastguard Worker    generation, "root" almost always refers to a "stack root" --- a local or
210*9880d681SAndroid Build Coastguard Worker    temporary variable within an executing function.
211*9880d681SAndroid Build Coastguard Worker
212*9880d681SAndroid Build Coastguard Worker**RPO**
213*9880d681SAndroid Build Coastguard Worker    Reverse postorder
214*9880d681SAndroid Build Coastguard Worker
215*9880d681SAndroid Build Coastguard WorkerS
216*9880d681SAndroid Build Coastguard Worker-
217*9880d681SAndroid Build Coastguard Worker
218*9880d681SAndroid Build Coastguard Worker.. _safe point:
219*9880d681SAndroid Build Coastguard Worker
220*9880d681SAndroid Build Coastguard Worker**Safe Point**
221*9880d681SAndroid Build Coastguard Worker    In garbage collection, it is necessary to identify `stack roots`_ so that
222*9880d681SAndroid Build Coastguard Worker    reachability analysis may proceed. It may be infeasible to provide this
223*9880d681SAndroid Build Coastguard Worker    information for every instruction, so instead the information may is
224*9880d681SAndroid Build Coastguard Worker    calculated only at designated safe points. With a copying collector,
225*9880d681SAndroid Build Coastguard Worker    `derived pointers`_ must not be retained across safe points and `object
226*9880d681SAndroid Build Coastguard Worker    pointers`_ must be reloaded from stack roots.
227*9880d681SAndroid Build Coastguard Worker
228*9880d681SAndroid Build Coastguard Worker**SDISel**
229*9880d681SAndroid Build Coastguard Worker    Selection DAG Instruction Selection.
230*9880d681SAndroid Build Coastguard Worker
231*9880d681SAndroid Build Coastguard Worker**SCC**
232*9880d681SAndroid Build Coastguard Worker    Strongly Connected Component
233*9880d681SAndroid Build Coastguard Worker
234*9880d681SAndroid Build Coastguard Worker**SCCP**
235*9880d681SAndroid Build Coastguard Worker    Sparse Conditional Constant Propagation
236*9880d681SAndroid Build Coastguard Worker
237*9880d681SAndroid Build Coastguard Worker**SLP**
238*9880d681SAndroid Build Coastguard Worker    Superword-Level Parallelism, same as :ref:`Basic-Block Vectorization
239*9880d681SAndroid Build Coastguard Worker    <lexicon-bb-vectorization>`.
240*9880d681SAndroid Build Coastguard Worker
241*9880d681SAndroid Build Coastguard Worker**SRoA**
242*9880d681SAndroid Build Coastguard Worker    Scalar Replacement of Aggregates
243*9880d681SAndroid Build Coastguard Worker
244*9880d681SAndroid Build Coastguard Worker**SSA**
245*9880d681SAndroid Build Coastguard Worker    Static Single Assignment
246*9880d681SAndroid Build Coastguard Worker
247*9880d681SAndroid Build Coastguard Worker**Stack Map**
248*9880d681SAndroid Build Coastguard Worker    In garbage collection, metadata emitted by the code generator which
249*9880d681SAndroid Build Coastguard Worker    identifies `roots`_ within the stack frame of an executing function.
250*9880d681SAndroid Build Coastguard Worker
251*9880d681SAndroid Build Coastguard WorkerT
252*9880d681SAndroid Build Coastguard Worker-
253*9880d681SAndroid Build Coastguard Worker
254*9880d681SAndroid Build Coastguard Worker**TBAA**
255*9880d681SAndroid Build Coastguard Worker    Type-Based Alias Analysis
256*9880d681SAndroid Build Coastguard Worker
257