Skip to content
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
38 changes: 19 additions & 19 deletions llvm/docs/Passes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@ Introduction
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
This document serves as a high-level summary of the optimization features that
LLVM provides. Optimizations are implemented as Passes that traverse some
portion of a program to either collect information or transform the program.
The table below divides the passes that LLVM provides into three categories.
Analysis passes compute information that other passes can use or for debugging
or program visualization purposes. Transform passes can use (or invalidate)
the analysis passes. Transform passes all mutate the program in some way.
Utility passes provides some utility but don't otherwise fit categorization.
For example passes to extract functions to bitcode or write a module to bitcode
Utility passes provide some utility but don't otherwise fit categorization.
For example, passes to extract functions to bitcode or write a module to bitcode
are neither analysis nor transform passes. The table of contents above
provides a quick summary of each pass and links to the more complete pass
description later in the document.
Expand Down Expand Up @@ -61,7 +61,7 @@ Yet to be written.
``da``: Dependence Analysis
---------------------------

Dependence analysis framework, which is used to detect dependences in memory
Dependence analysis framework, which is used to detect dependencies in memory
accesses.

``domfrontier``: Dominance Frontier Construction
Expand Down Expand Up @@ -90,7 +90,7 @@ postscript or some other suitable format.
This pass, only available in ``opt``, prints the control flow graph into a
``.dot`` graph. This graph can then be processed with the :program:`dot` tool
to convert it to postscript or some other suitable format.
Additionally the ``-cfg-func-name=<substring>`` option can be used to filter the
Additionally, the ``-cfg-func-name=<substring>`` option can be used to filter the
functions that are printed. All functions that contain the specified substring
will be printed.

Expand All @@ -101,7 +101,7 @@ This pass, only available in ``opt``, prints the control flow graph into a
``.dot`` graph, omitting the function bodies. This graph can then be processed
with the :program:`dot` tool to convert it to postscript or some other suitable
format.
Additionally the ``-cfg-func-name=<substring>`` option can be used to filter the
Additionally, the ``-cfg-func-name=<substring>`` option can be used to filter the
functions that are printed. All functions that contain the specified substring
will be printed.

Expand Down Expand Up @@ -240,7 +240,7 @@ standard error in a human-readable form.
---------------------------------------------------

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

``function(print)``: Print function to stderr
---------------------------------------------
Expand Down Expand Up @@ -486,7 +486,7 @@ Bottom-up inlining of functions into callees.
``instcombine``: Combine redundant instructions
-----------------------------------------------

Combine instructions to form fewer, simple instructions. This pass does not
Combine instructions to form fewer, simpler instructions. This pass does not
modify the CFG. This pass is where algebraic simplification happens.

This pass combines things like:
Expand All @@ -502,7 +502,7 @@ into:

%Z = add i32 %X, 2

This is a simple worklist driven algorithm.
This is a simple worklist-driven algorithm.

This pass guarantees that the following canonicalizations are performed on the
program:
Expand Down Expand Up @@ -532,9 +532,9 @@ library calls on different targets.
``aggressive-instcombine``: Combine expression patterns
--------------------------------------------------------

Combine expression patterns to form expressions with fewer, simple instructions.
Combine expression patterns to form expressions with fewer, simpler instructions.

For example, this pass reduce width of expressions post-dominated by TruncInst
For example, this pass reduces the width of expressions post-dominated by ``TruncInst``
into smaller width when applicable.

It differs from instcombine pass in that it can modify CFG and contains pattern
Expand Down Expand Up @@ -722,7 +722,7 @@ determine the trip counts of loops easily.
---------------------------------------------

This pass implements a simple unroll and jam classical loop optimisation pass.
It transforms loop from:
It transforms a loop from:

.. code-block:: c++

Expand Down Expand Up @@ -799,11 +799,11 @@ This pass looks for equivalent functions that are mergeable and folds them.

Total-ordering is introduced among the functions set: we define comparison
that answers for every two functions which of them is greater. It allows to
arrange functions into the binary tree.
arrange functions into a binary tree.

For every new function we check for equivalent in tree.
For every new function we check for equivalent in the tree.

If equivalent exists we fold such functions. If both functions are overridable,
If equivalent exists, we fold such functions. If both functions are overridable,
we move the functionality into a new internal function and leave two
overridable thunks to it.

Expand Down Expand Up @@ -838,7 +838,7 @@ For example: 4 + (x + 5) ⇒ x + (4 + 5)

In the implementation of this algorithm, constants are assigned rank = 0,
function arguments are rank = 1, and other values are assigned ranks
corresponding to the reverse post order traversal of current function (starting
corresponding to the reverse post-order traversal of the current function (starting
at 2), which effectively gives values in deep loops higher rank than values not
in loops.

Expand Down Expand Up @@ -1019,7 +1019,7 @@ noisy.
``verify``: Module Verifier
---------------------------

Verifies an LLVM IR code. This is useful to run after an optimization which is
Verifies LLVM IR code. This is useful to run after an optimization which is
undergoing testing. Note that llvm-as verifies its input before emitting
bitcode, and also that malformed bitcode is likely to make LLVM crash. All
language front-ends are therefore encouraged to verify their output before
Expand Down Expand Up @@ -1059,7 +1059,7 @@ instead just tries to ensure that code is well-formed.
----------------------------------

Displays the control flow graph using the GraphViz tool.
Additionally the ``-cfg-func-name=<substring>`` option can be used to filter the
Additionally, the ``-cfg-func-name=<substring>`` option can be used to filter the
functions that are displayed. All functions that contain the specified substring
will be displayed.

Expand All @@ -1068,7 +1068,7 @@ will be displayed.

Displays the control flow graph using the GraphViz tool, but omitting function
bodies.
Additionally the ``-cfg-func-name=<substring>`` option can be used to filter the
Additionally, the ``-cfg-func-name=<substring>`` option can be used to filter the
functions that are displayed. All functions that contain the specified substring
will be displayed.

Expand Down
Loading