aboutsummaryrefslogtreecommitdiffstats
path: root/docs/Vectorizers.rst
diff options
context:
space:
mode:
authorSean Silva <silvas@purdue.edu>2012-12-20 22:47:41 +0000
committerSean Silva <silvas@purdue.edu>2012-12-20 22:47:41 +0000
commit9baa6e4c36565855bbdc4548ca16105f10aaf8ac (patch)
tree347cb4347c32484627a40fe0c1940dd81415cee0 /docs/Vectorizers.rst
parent12ae515945baa9bc1b524c0fc4005acd5c81587e (diff)
downloadexternal_llvm-9baa6e4c36565855bbdc4548ca16105f10aaf8ac.zip
external_llvm-9baa6e4c36565855bbdc4548ca16105f10aaf8ac.tar.gz
external_llvm-9baa6e4c36565855bbdc4548ca16105f10aaf8ac.tar.bz2
docs: Indent consistently in code examples.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@170791 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'docs/Vectorizers.rst')
-rw-r--r--docs/Vectorizers.rst20
1 files changed, 10 insertions, 10 deletions
diff --git a/docs/Vectorizers.rst b/docs/Vectorizers.rst
index d5bc90b..fbafe6b 100644
--- a/docs/Vectorizers.rst
+++ b/docs/Vectorizers.rst
@@ -54,8 +54,8 @@ a scalar copy of the loop increases the code size.
.. code-block:: c++
void bar(float *A, float* B, float K, int start, int end) {
- for (int i = start; i < end; ++i)
- A[i] *= B[i] + K;
+ for (int i = start; i < end; ++i)
+ A[i] *= B[i] + K;
}
Runtime Checks of Pointers
@@ -75,8 +75,8 @@ of the loop is executed.
.. code-block:: c++
void bar(float *A, float* B, float K, int n) {
- for (int i = 0; i < n; ++i)
- A[i] *= B[i] + K;
+ for (int i = 0; i < n; ++i)
+ A[i] *= B[i] + K;
}
@@ -108,8 +108,8 @@ array. The Loop Vectorizer knows to vectorize induction variables.
.. code-block:: c++
void bar(float *A, float* B, float K, int n) {
- for (int i = 0; i < n; ++i)
- A[i] = i;
+ for (int i = 0; i < n; ++i)
+ A[i] = i;
}
If Conversion
@@ -165,8 +165,8 @@ memory accesses.
.. code-block:: c++
int foo(int *A, int *B, int n, int k) {
- for (int i = 0; i < n; ++i)
- A[i*7] += B[i*k];
+ for (int i = 0; i < n; ++i)
+ A[i*7] += B[i*k];
}
Vectorization of Mixed Types
@@ -179,8 +179,8 @@ vectorization is profitable.
.. code-block:: c++
int foo(int *A, char *B, int n, int k) {
- for (int i = 0; i < n; ++i)
- A[i] += 4 * B[i];
+ for (int i = 0; i < n; ++i)
+ A[i] += 4 * B[i];
}
Vectorization of function calls