Skip to content

Commit 36c0eab

Browse files
[llvm] Proofread Passes.rst (#159243)
1 parent 901eaee commit 36c0eab

File tree

1 file changed

+19
-19
lines changed

1 file changed

+19
-19
lines changed

llvm/docs/Passes.rst

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,15 @@ Introduction
1616
is most likely incomplete. It is possible to list passes known by the opt
1717
tool using ``opt -print-passes``.
1818

19-
This document serves as a high level summary of the optimization features that
19+
This document serves as a high-level summary of the optimization features that
2020
LLVM provides. Optimizations are implemented as Passes that traverse some
2121
portion of a program to either collect information or transform the program.
2222
The table below divides the passes that LLVM provides into three categories.
2323
Analysis passes compute information that other passes can use or for debugging
2424
or program visualization purposes. Transform passes can use (or invalidate)
2525
the analysis passes. Transform passes all mutate the program in some way.
26-
Utility passes provides some utility but don't otherwise fit categorization.
27-
For example passes to extract functions to bitcode or write a module to bitcode
26+
Utility passes provide some utility but don't otherwise fit categorization.
27+
For example, passes to extract functions to bitcode or write a module to bitcode
2828
are neither analysis nor transform passes. The table of contents above
2929
provides a quick summary of each pass and links to the more complete pass
3030
description later in the document.
@@ -61,7 +61,7 @@ Yet to be written.
6161
``da``: Dependence Analysis
6262
---------------------------
6363

64-
Dependence analysis framework, which is used to detect dependences in memory
64+
Dependence analysis framework, which is used to detect dependencies in memory
6565
accesses.
6666

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

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

@@ -240,7 +240,7 @@ standard error in a human-readable form.
240240
---------------------------------------------------
241241

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

245245
``function(print)``: Print function to stderr
246246
---------------------------------------------
@@ -486,7 +486,7 @@ Bottom-up inlining of functions into callees.
486486
``instcombine``: Combine redundant instructions
487487
-----------------------------------------------
488488

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

492492
This pass combines things like:
@@ -502,7 +502,7 @@ into:
502502
503503
%Z = add i32 %X, 2
504504
505-
This is a simple worklist driven algorithm.
505+
This is a simple worklist-driven algorithm.
506506

507507
This pass guarantees that the following canonicalizations are performed on the
508508
program:
@@ -532,9 +532,9 @@ library calls on different targets.
532532
``aggressive-instcombine``: Combine expression patterns
533533
--------------------------------------------------------
534534

535-
Combine expression patterns to form expressions with fewer, simple instructions.
535+
Combine expression patterns to form expressions with fewer, simpler instructions.
536536

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

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

724724
This pass implements a simple unroll and jam classical loop optimisation pass.
725-
It transforms loop from:
725+
It transforms a loop from:
726726

727727
.. code-block:: c++
728728

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

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

804-
For every new function we check for equivalent in tree.
804+
For every new function we check for equivalent in the tree.
805805

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

@@ -838,7 +838,7 @@ For example: 4 + (x + 5) ⇒ x + (4 + 5)
838838

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

@@ -1019,7 +1019,7 @@ noisy.
10191019
``verify``: Module Verifier
10201020
---------------------------
10211021

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

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

@@ -1068,7 +1068,7 @@ will be displayed.
10681068

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

0 commit comments

Comments
 (0)