[llvm] r203734 - Fix vectorizer docs.
Arnold Schwaighofer
aschwaighofer at apple.com
Wed Mar 12 16:54:36 PDT 2014
On Mar 12, 2014, at 4:36 PM, Chandler Carruth <chandlerc at google.com> wrote:
>
> On Wed, Mar 12, 2014 at 4:23 PM, Arnold Schwaighofer <aschwaighofer at apple.com> wrote:
> Fix vectorizer docs.
>
> This example is not vectorized because LLVM does not prove no-wrapping of
> "a[i*7] += ...".
>
> See my other email, but...
>
>
> - 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];
>
> I don't believe that this can possibly change whether or not any of this pointer arithmetic could possibly wrap. I mean... maybe I'm missing something blindly obvious and just have a think-o moment... but I *really* don't think this is remotely possible.
>
Wrapping only matters for store to load safety. As I explained in the other email, it is a matter of LLVM not being able to prove this atm. Not that this example is unsafe. It is not. The page describes examples that LLVM can vectorize so I took this example out :).
More information about the llvm-commits
mailing list