Skip to content

Commit ce43e5a

Browse files
committed
80 columns in lang ref and remove some extra usage info
1 parent 845e9bc commit ce43e5a

File tree

1 file changed

+19
-16
lines changed

1 file changed

+19
-16
lines changed

llvm/docs/LangRef.rst

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -23644,7 +23644,8 @@ This is an overloaded intrinsic.
2364423644
Overview:
2364523645
"""""""""
2364623646

23647-
Create a mask representing lanes that do or not overlap between two pointers across one vector loop iteration.
23647+
Create a mask representing lanes that do or not overlap between two pointers
23648+
across one vector loop iteration.
2364823649

2364923650

2365023651
Arguments:
@@ -23656,8 +23657,9 @@ The final two are immediates and the result is a vector with the i1 element type
2365623657
Semantics:
2365723658
""""""""""
2365823659

23659-
In the case that ``%writeAfterRead`` is true, the '``llvm.experimental.get.alias.lane.mask.*``' intrinsics are semantically equivalent
23660-
to:
23660+
In the case that ``%writeAfterRead`` is true, the
23661+
'``llvm.experimental.get.alias.lane.mask.*``' intrinsics are semantically
23662+
equivalent to:
2366123663

2366223664
::
2366323665

@@ -23673,26 +23675,27 @@ Otherwise they are semantically equivalent to:
2367323675

2367423676
where ``%m`` is a vector (mask) of active/inactive lanes with its elements
2367523677
indexed by ``i``, and ``%ptrA``, ``%ptrB`` are the two i64 arguments to
23676-
``llvm.experimental.get.alias.lane.mask.*``, ``%elementSize`` is the first immediate argument, ``%abs`` is the absolute difference operation, ``%icmp`` is an integer compare and ``ult``
23677-
the unsigned less-than comparison operator. The subtraction between ``%ptrA`` and ``%ptrB`` could be negative. The ``%writeAfterRead`` argument is expected to be true if the ``%ptrB`` is stored to after ``%ptrA`` is read from.
23678+
``llvm.experimental.get.alias.lane.mask.*``, ``%elementSize`` is the first
23679+
immediate argument, ``%abs`` is the absolute difference operation, ``%icmp`` is
23680+
an integer compare and ``ult`` the unsigned less-than comparison operator. The
23681+
subtraction between ``%ptrA`` and ``%ptrB`` could be negative. The
23682+
``%writeAfterRead`` argument is expected to be true if the ``%ptrB`` is stored
23683+
to after ``%ptrA`` is read from.
2367823684
The above is equivalent to:
2367923685

2368023686
::
2368123687

2368223688
%m = @llvm.experimental.get.alias.lane.mask(%ptrA, %ptrB, %elementSize, %writeAfterRead)
2368323689

2368423690
This can, for example, be emitted by the loop vectorizer in which case
23685-
``%ptrA`` is a pointer that is read from within the loop, and ``%ptrB`` is a pointer that is stored to within the loop.
23686-
If the difference between these pointers is less than the vector factor, then they overlap (alias) within a loop iteration.
23687-
An example is if ``%ptrA`` is 20 and ``%ptrB`` is 23 with a vector factor of 8, then lanes 3, 4, 5, 6 and 7 of the vector loaded from ``%ptrA``
23688-
share addresses with lanes 0, 1, 2, 3, 4 and 5 from the vector stored to at ``%ptrB``.
23689-
An alias mask of these two pointers should be <1, 1, 1, 0, 0, 0, 0, 0> so that only the non-overlapping lanes are loaded and stored.
23690-
This operation allows many loops to be vectorised when it would otherwise be unsafe to do so.
23691-
23692-
To account for the fact that only a subset of lanes have been operated on in an iteration,
23693-
the loop's induction variable should be incremented by the popcount of the mask rather than the vector factor.
23694-
23695-
This mask ``%m`` can e.g. be used in masked load/store instructions.
23691+
``%ptrA`` is a pointer that is read from within the loop, and ``%ptrB`` is a
23692+
pointer that is stored to within the loop.
23693+
If the difference between these pointers is less than the vector factor, then
23694+
they overlap (alias) within a loop iteration.
23695+
An example is if ``%ptrA`` is 20 and ``%ptrB`` is 23 with a vector factor of 8,
23696+
then lanes 3, 4, 5, 6 and 7 of the vector loaded from ``%ptrA``
23697+
share addresses with lanes 0, 1, 2, 3, 4 and 5 from the vector stored to at
23698+
``%ptrB``.
2369623699

2369723700

2369823701
Examples:

0 commit comments

Comments
 (0)