summaryrefslogtreecommitdiffstats
path: root/llvm/docs/Vectorizers.rst
diff options
context:
space:
mode:
authorSanjay Patel <spatel@rotateright.com>2019-12-09 17:07:30 -0500
committerSanjay Patel <spatel@rotateright.com>2019-12-10 09:32:40 -0500
commita0c558ee4cc0f8cd1d30edac5f4fbdedb18eff21 (patch)
tree56a0b22fdc592f582f5189c5949b2293b38dbb0d /llvm/docs/Vectorizers.rst
parent1b2842bf902a8b52acbef2425120533b63be5ae3 (diff)
downloadbcm5719-llvm-a0c558ee4cc0f8cd1d30edac5f4fbdedb18eff21.tar.gz
bcm5719-llvm-a0c558ee4cc0f8cd1d30edac5f4fbdedb18eff21.zip
[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
Diffstat (limited to 'llvm/docs/Vectorizers.rst')
-rw-r--r--llvm/docs/Vectorizers.rst6
1 files changed, 4 insertions, 2 deletions
diff --git a/llvm/docs/Vectorizers.rst b/llvm/docs/Vectorizers.rst
index fd1525c00ca..f8477f20f03 100644
--- a/llvm/docs/Vectorizers.rst
+++ b/llvm/docs/Vectorizers.rst
@@ -418,8 +418,10 @@ into vector operations.
.. code-block:: c++
void foo(int a1, int a2, int b1, int b2, int *A) {
- A[0] = a1*(a1 + b1)/b1 + 50*b1/a1;
- A[1] = a2*(a2 + b2)/b2 + 50*b2/a2;
+ A[0] = a1*(a1 + b1);
+ A[1] = a2*(a2 + b2);
+ A[2] = a1*(a1 + b1);
+ A[3] = a2*(a2 + b2);
}
The SLP-vectorizer processes the code bottom-up, across basic blocks, in search of scalars to combine.
OpenPOWER on IntegriCloud