summaryrefslogtreecommitdiffstats
path: root/llvm/docs
diff options
context:
space:
mode:
authorNadav Rotem <nrotem@apple.com>2013-04-15 05:53:23 +0000
committerNadav Rotem <nrotem@apple.com>2013-04-15 05:53:23 +0000
commit57da1fdd5556370963e8e7673feab5a09e64d05d (patch)
tree4dbe9f8b37c8044efc45db48b53a79cdbb7377da /llvm/docs
parentd4dcc003df2eed9a600277e72d24460491f25f93 (diff)
downloadbcm5719-llvm-57da1fdd5556370963e8e7673feab5a09e64d05d.tar.gz
bcm5719-llvm-57da1fdd5556370963e8e7673feab5a09e64d05d.zip
Docs: merge the description of the BB and SLP vectorizers and document the -fslp-vectorize-aggressive flag.
llvm-svn: 179510
Diffstat (limited to 'llvm/docs')
-rw-r--r--llvm/docs/Vectorizers.rst48
1 files changed, 23 insertions, 25 deletions
diff --git a/llvm/docs/Vectorizers.rst b/llvm/docs/Vectorizers.rst
index 42e03d29784..693a148fa54 100644
--- a/llvm/docs/Vectorizers.rst
+++ b/llvm/docs/Vectorizers.rst
@@ -292,25 +292,15 @@ And Linpack-pc with the same configuration. Result is Mflops, higher is better.
.. image:: linpack-pc.png
-.. _bb-vectorizer:
-
-The Basic Block Vectorizer
-==========================
-
-Usage
-------
-
-The Basic Block Vectorizer is not enabled by default, but it can be enabled
-through clang using the command line flag:
-
-.. code-block:: console
+.. _slp-vectorizer:
- $ clang -fslp-vectorize file.c
+The SLP Vectorizer
+==================
Details
-------
-The goal of basic-block vectorization (a.k.a. superword-level parallelism) is
+The goal of SLP vectorization (a.k.a. superword-level parallelism) is
to combine similar independent instructions within simple control-flow regions
into vector instructions. Memory accesses, arithemetic operations, comparison
operations and some math functions can all be vectorized using this technique
@@ -322,22 +312,30 @@ into vector operations.
.. code-block:: c++
- int foo(int a1, int a2, int b1, int b2) {
- int r1 = a1*(a1 + b1)/b1 + 50*b1/a1;
- int r2 = a2*(a2 + b2)/b2 + 50*b2/a2;
- return r1 + r2;
+ 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;
}
-.. _slp-vectorizer:
+Usage
+------
-The SLP Vectorizer
-==========================
+The SLP Vectorizer is not enabled by default, but it can be enabled
+through clang using the command line flag:
+
+.. code-block:: console
+
+ $ clang -fslp-vectorize file.c
+
+LLVM has a second phase basic block vectorization phase
+which is more compile-time intensive (The BB vectorizer). This optimization
+can be enabled through clang using the command line flag:
+
+.. code-block:: console
+
+ $ clang -fslp-vectorize-aggressive file.c
-The SLP vectorizer (superword-level parallelism) is a new experimental
-infrastructure for vectorizing code and rolling loops.
-A major focus of the work on the SLP vectorizer is to make it fast and
-flexible. It is designed as a library that can be used by other passes.
The SLP vectorizer is in early development stages but can already vectorize
and accelerate many programs in the LLVM test suite.
OpenPOWER on IntegriCloud