diff options
author | Arnold Schwaighofer <aschwaighofer@apple.com> | 2014-03-12 23:23:44 +0000 |
---|---|---|
committer | Arnold Schwaighofer <aschwaighofer@apple.com> | 2014-03-12 23:23:44 +0000 |
commit | 34ac9be1d7c60410cec282f0a26f63c2afae19ff (patch) | |
tree | 557846b1b62c4ef9e74355b8294f91fdda6cefc4 /llvm/docs/Vectorizers.rst | |
parent | 8e6002f3bd52a87d697b348ac5d049898c8214d5 (diff) | |
download | bcm5719-llvm-34ac9be1d7c60410cec282f0a26f63c2afae19ff.tar.gz bcm5719-llvm-34ac9be1d7c60410cec282f0a26f63c2afae19ff.zip |
Fix vectorizer docs.
This example is not vectorized because LLVM does not prove no-wrapping of
"a[i*7] += ...".
llvm-svn: 203734
Diffstat (limited to 'llvm/docs/Vectorizers.rst')
-rw-r--r-- | llvm/docs/Vectorizers.rst | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/llvm/docs/Vectorizers.rst b/llvm/docs/Vectorizers.rst index 61ebca2bb52..823fd9e6702 100644 --- a/llvm/docs/Vectorizers.rst +++ b/llvm/docs/Vectorizers.rst @@ -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 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |