Skip to content

[docs][passes] Update documentation of Analysis and Transform Passes #80835

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Feb 7, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 16 additions & 44 deletions llvm/docs/Passes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ LLVM's Analysis and Transform Passes

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

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

``module-debuginfo``: Decodes module-level debug info
-----------------------------------------------------
``print<module-debuginfo>``: Decodes module-level debug info
------------------------------------------------------------

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

For example, run this pass from ``opt`` along with the ``-analyze`` option, and
it'll print to standard output.

``postdomtree``: Post-Dominator Tree Construction
-------------------------------------------------

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

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

``print-function``: Print function to stderr
--------------------------------------------
``function(print)``: Print function to stderr
---------------------------------------------

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

``print-module``: Print module to stderr
----------------------------------------
``module(print)``: Print module to stderr
-----------------------------------------

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

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

.. FIXME: this description is the same as for -strip

performs code stripping. this transformation can delete:

* names for virtual registers
* symbols for internal globals and functions
* debug information

note that this transformation makes code much less readable, so it should only
be used in situations where the strip utility would be used, such as reducing
code size or making it harder to reverse engineer code.
Performs code stripping. Similar to strip, but only strips debug info for
unused symbols.

``strip-dead-prototypes``: Strip Unused Function Prototypes
-----------------------------------------------------------
Expand All @@ -947,32 +938,13 @@ functions).
``strip-debug-declare``: Strip all ``llvm.dbg.declare`` intrinsics
------------------------------------------------------------------

.. FIXME: this description is the same as for -strip

This pass implements code stripping. Specifically, it can delete:

#. names for virtual registers
#. symbols for internal globals and functions
#. debug information

Note that this transformation makes code much less readable, so it should only
be used in situations where the 'strip' utility would be used, such as reducing
code size or making it harder to reverse engineer code.
Performs code stripping. Similar to strip, but only strips
``llvm.dbg.declare`` intrinsics.

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

.. FIXME: this description is the same as for -strip

This pass implements code stripping. Specifically, it can delete:

#. names for virtual registers
#. symbols for internal globals and functions
#. debug information

Note that this transformation makes code much less readable, so it should only
be used in situations where the 'strip' utility would be used, such as reducing
code size or making it harder to reverse engineer code.
Performs code stripping. Similar to strip, but dbg info is preserved.

``tailcallelim``: Tail Call Elimination
---------------------------------------
Expand Down