Skip to content

Commit 93962ea

Browse files
authored
[docs][passes] Update documentation of Analysis and Transform Passes (#80835)
- Added a warning about the pass list being incomplete (and hint about "opt -print-passes" listing known passes). - Removed legacy PM example involving "opt -analyze". - print-function and print-module does not exist with those names in the new PM. Since the document has been updated to reflect the new PM names earlier, those names were changed into referring to function(print) and module(print) instead. - Resolved some FIXME:s around strip* passes.
1 parent e7c0e59 commit 93962ea

File tree

1 file changed

+16
-44
lines changed

1 file changed

+16
-44
lines changed

llvm/docs/Passes.rst

Lines changed: 16 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ LLVM's Analysis and Transform Passes
77

88
Introduction
99
============
10+
.. warning:: This document is not updated frequently, and the list of passes
11+
is most likely incomplete. It is possible to list passes known by the opt
12+
tool using ``opt -print-passes``.
1013

1114
This document serves as a high level summary of the optimization features that
1215
LLVM provides. Optimizations are implemented as Passes that traverse some
@@ -193,15 +196,12 @@ memory operations it depends on. It builds on alias analysis information, and
193196
tries to provide a lazy, caching interface to a common kind of alias
194197
information query.
195198

196-
``module-debuginfo``: Decodes module-level debug info
197-
-----------------------------------------------------
199+
``print<module-debuginfo>``: Decodes module-level debug info
200+
------------------------------------------------------------
198201

199-
This pass decodes the debug info metadata in a module and prints in a
202+
This pass decodes the debug info metadata in a module and prints it to standard output in a
200203
(sufficiently-prepared-) human-readable form.
201204

202-
For example, run this pass from ``opt`` along with the ``-analyze`` option, and
203-
it'll print to standard output.
204-
205205
``postdomtree``: Post-Dominator Tree Construction
206206
-------------------------------------------------
207207

@@ -228,18 +228,18 @@ standard error in a human-readable form.
228228
``print-cfg-sccs``: Print SCCs of each function CFG
229229
---------------------------------------------------
230230

231-
This pass, only available in ``opt``, printsthe SCCs of each function CFG to
231+
This pass, only available in ``opt``, prints the SCCs of each function CFG to
232232
standard error in a human-readable fom.
233233

234-
``print-function``: Print function to stderr
235-
--------------------------------------------
234+
``function(print)``: Print function to stderr
235+
---------------------------------------------
236236

237237
The ``PrintFunctionPass`` class is designed to be pipelined with other
238238
``FunctionPasses``, and prints out the functions of the module as they are
239239
processed.
240240

241-
``print-module``: Print module to stderr
242-
----------------------------------------
241+
``module(print)``: Print module to stderr
242+
-----------------------------------------
243243

244244
This pass simply prints out the entire module when it is executed.
245245

@@ -924,17 +924,8 @@ code size or making it harder to reverse engineer code.
924924
``strip-dead-debug-info``: Strip debug info for unused symbols
925925
--------------------------------------------------------------
926926

927-
.. FIXME: this description is the same as for -strip
928-
929-
performs code stripping. this transformation can delete:
930-
931-
* names for virtual registers
932-
* symbols for internal globals and functions
933-
* debug information
934-
935-
note that this transformation makes code much less readable, so it should only
936-
be used in situations where the strip utility would be used, such as reducing
937-
code size or making it harder to reverse engineer code.
927+
Performs code stripping. Similar to strip, but only strips debug info for
928+
unused symbols.
938929

939930
``strip-dead-prototypes``: Strip Unused Function Prototypes
940931
-----------------------------------------------------------
@@ -947,32 +938,13 @@ functions).
947938
``strip-debug-declare``: Strip all ``llvm.dbg.declare`` intrinsics
948939
------------------------------------------------------------------
949940

950-
.. FIXME: this description is the same as for -strip
951-
952-
This pass implements code stripping. Specifically, it can delete:
953-
954-
#. names for virtual registers
955-
#. symbols for internal globals and functions
956-
#. debug information
957-
958-
Note that this transformation makes code much less readable, so it should only
959-
be used in situations where the 'strip' utility would be used, such as reducing
960-
code size or making it harder to reverse engineer code.
941+
Performs code stripping. Similar to strip, but only strips
942+
``llvm.dbg.declare`` intrinsics.
961943

962944
``strip-nondebug``: Strip all symbols, except dbg symbols, from a module
963945
------------------------------------------------------------------------
964946

965-
.. FIXME: this description is the same as for -strip
966-
967-
This pass implements code stripping. Specifically, it can delete:
968-
969-
#. names for virtual registers
970-
#. symbols for internal globals and functions
971-
#. debug information
972-
973-
Note that this transformation makes code much less readable, so it should only
974-
be used in situations where the 'strip' utility would be used, such as reducing
975-
code size or making it harder to reverse engineer code.
947+
Performs code stripping. Similar to strip, but dbg info is preserved.
976948

977949
``tailcallelim``: Tail Call Elimination
978950
---------------------------------------

0 commit comments

Comments
 (0)