Issue 159309
Summary [loopvectorize] outer loop vectorize fail
Labels new issue
Assignees
Reporter heiman1
    Reproduce: https://godbolt.org/z/Edevenxo5

code:
`for (int jj = 0; jj < nnei; jj++) {
        // construct the dy/dx
        ll[0] = em[jj * 4 + 0];
 ll[1] = em[jj * 4 + 1];
        FPTYPE xx = em_x[jj];
        FPTYPE grad = 0.0;
        #pragma clang loop vectorize(assume_safety)
        for (int kk = 0; kk < last_layer_size; kk++) {
            rr[0] = dy[0 * last_layer_size + kk];
            FPTYPE a0 = table[jj * last_layer_size * 6 + 6 * kk + 0];

            grad += a0 * rr[0] * (nnei - jj);

 for (int jj2 = 0; jj2 < nnei-jj; jj2++) {
              dtwo[(jj2+jj) * last_layer_size + kk] += xx;
            }
        }
        dem[jj * 4 + 0] += grad;
 }`
<img width="868" height="202" alt="Image" src="" />

Is there a good solution to enable outer layer vectorization?
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to