Commit 3b19a92b authored by Bill Wendling's avatar Bill Wendling
Browse files

Update lang ref.

llvm-svn: 216950
parent 40a62e6d
Loading
Loading
Loading
Loading
+3 −49
Original line number Diff line number Diff line
@@ -2902,15 +2902,15 @@ constructs:

The loop identifier metadata can be used to specify additional
per-loop metadata. Any operands after the first operand can be treated
as user-defined metadata. For example the ``llvm.loop.unroll.count``
suggests an unroll factor to the loop unroller:
as user-defined metadata. For example the ``llvm.loop.interleave.count``
suggests an interleave factor to the loop interleaver:

.. code-block:: llvm

      br i1 %exitcond, label %._crit_edge, label %.lr.ph, !llvm.loop !0
    ...
    !0 = metadata !{ metadata !0, metadata !1 }
    !1 = metadata !{ metadata !"llvm.loop.unroll.count", i32 4 }
    !1 = metadata !{ metadata !"llvm.loop.interleave.count", i32 4 }

'``llvm.loop.vectorize``' and '``llvm.loop.interleave``'
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -2970,52 +2970,6 @@ vectorization of the loop. If ``llvm.loop.vectorize.width`` is set to
0 or if the loop does not have this metadata the width will be
determined automatically.

'``llvm.loop.unroll``'
^^^^^^^^^^^^^^^^^^^^^^

Metadata prefixed with ``llvm.loop.unroll`` are loop unrolling
optimization hints such as the unroll factor. ``llvm.loop.unroll``
metadata should be used in conjunction with ``llvm.loop`` loop
identification metadata. The ``llvm.loop.unroll`` metadata are only
optimization hints and the unrolling will only be performed if the
optimizer believes it is safe to do so.

'``llvm.loop.unroll.enable``' Metadata
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

This metadata either disables loop unrolling or suggests that the loop
be unrolled fully. The first operand is the string
``llvm.loop.unroll.enable`` and the second operand is a bit.  If the
bit operand value is 0 loop unrolling is disabled. A value of 1
indicates that the loop should be fully unrolled. For example:

.. code-block:: llvm

   !0 = metadata !{ metadata !"llvm.loop.unroll.enable", i1 0 }
   !1 = metadata !{ metadata !"llvm.loop.unroll.enable", i1 1 }

'``llvm.loop.unroll.count``' Metadata
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

This metadata suggests an unroll factor to the loop unroller. The
first operand is the string ``llvm.loop.unroll.count`` and the second
operand is a positive integer specifying the unroll factor. For
example:

.. code-block:: llvm

   !0 = metadata !{ metadata !"llvm.loop.unroll.count", i32 4 }

If the trip count of the loop is less than the unroll count the loop
will be partially unrolled.

If a loop has both a ``llvm.loop.unroll.enable`` metadata and
``llvm.loop.unroll.count`` metadata the behavior depends upon the
value of the ``llvm.loop.unroll.enable`` operand.  If the value is 0,
the loop will not be unrolled.  If the value is 1, the loop will be
unrolled with a factor determined by the ``llvm.loop.unroll.count``
operand effectively ignoring the ``llvm.loop.unroll.enable`` metadata.

'``llvm.mem``'
^^^^^^^^^^^^^^^