Skip to content

Commit a0c558e

Browse files
committed
[Docs] Improve SLP code snippet
New C code snippet is more viable for SLP vectorization in most architectures. Patch by: @lsandov1 (Leonardo Sandoval) Differential Revision: https://reviews.llvm.org/D70866
1 parent 1b2842b commit a0c558e

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

llvm/docs/Vectorizers.rst

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -418,8 +418,10 @@ into vector operations.
418418
.. code-block:: c++
419419

420420
void foo(int a1, int a2, int b1, int b2, int *A) {
421-
A[0] = a1*(a1 + b1)/b1 + 50*b1/a1;
422-
A[1] = a2*(a2 + b2)/b2 + 50*b2/a2;
421+
A[0] = a1*(a1 + b1);
422+
A[1] = a2*(a2 + b2);
423+
A[2] = a1*(a1 + b1);
424+
A[3] = a2*(a2 + b2);
423425
}
424426
425427
The SLP-vectorizer processes the code bottom-up, across basic blocks, in search of scalars to combine.

0 commit comments

Comments
 (0)