summaryrefslogtreecommitdiff
path: root/docs/Passes.rst
diff options
context:
space:
mode:
authorDavid Green <david.green@arm.com>2018-07-19 12:37:00 +0000
committerDavid Green <david.green@arm.com>2018-07-19 12:37:00 +0000
commit91823932bda4a288a66ef1ba157dbf2e644bfb60 (patch)
tree3f58259250e603986d3156f41b18656cfec7a78c /docs/Passes.rst
parentd13704d44f36e28c02ff6ca1e8849760fa020ead (diff)
[UnJ] Document unroll and jam pass and loop metadata
Add some quick words for unroll and jam to the list of passes and add unroll_and_jam metadata to the language ref. Differential Revision: https://reviews.llvm.org/D49349 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@337448 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'docs/Passes.rst')
-rw-r--r--docs/Passes.rst23
1 files changed, 23 insertions, 0 deletions
diff --git a/docs/Passes.rst b/docs/Passes.rst
index 39874e4c8a0..9ab214984d2 100644
--- a/docs/Passes.rst
+++ b/docs/Passes.rst
@@ -83,6 +83,8 @@ Yet to be written.
A pass which can be used to count how many alias queries are being made and how
the alias analysis implementation being used responds.
+.. _passes-da:
+
``-da``: Dependence Analysis
----------------------------
@@ -825,6 +827,27 @@ This pass implements a simple loop unroller. It works best when loops have
been canonicalized by the :ref:`indvars <passes-indvars>` pass, allowing it to
determine the trip counts of loops easily.
+``-loop-unroll-and-jam``: Unroll and Jam loops
+----------------------------------------------
+
+This pass implements a simple unroll and jam classical loop optimisation pass.
+It transforms loop from:
+
+.. code-block:: c++
+
+ for i.. i+= 1 for i.. i+= 4
+ for j.. for j..
+ code(i, j) code(i, j)
+ code(i+1, j)
+ code(i+2, j)
+ code(i+3, j)
+ remainder loop
+
+Which can be seen as unrolling the outer loop and "jamming" (fusing) the inner
+loops into one. When variables or loads can be shared in the new inner loop, this
+can lead to significant performance improvements. It uses
+:ref:`Dependence Analysis <passes-da>` for proving the transformations are safe.
+
``-loop-unswitch``: Unswitch loops
----------------------------------