Fix vectorizer docs.

This example is not vectorized because LLVM does not prove no-wrapping of
"a[i*7] += ...".

llvm-svn: 203734
This commit is contained in:
Arnold Schwaighofer 2014-03-12 23:23:44 +00:00
parent 8e6002f3bd
commit 34ac9be1d7
1 changed files with 6 additions and 3 deletions

View File

@ -182,11 +182,14 @@ that scatter/gathers memory.
.. 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];
int foo(int * A, int * B, int n) {
for (intptr_t i = 0; i < n; ++i)
A[i] += B[i*4];
}
In many situations the cost model will inform LLVM that this is not beneficial
and LLVM will only vectorize such code if forced with "-mllvm -force-vector-width=#".
Vectorization of Mixed Types
^^^^^^^^^^^^^^^^^^^^^^^^^^^^