LLVM opt unable to vectorize PolyBench code

Hello,

I m unable to vectorize following kernel by opt tool;

for (i = 0; i < _PB_NI; i++)
for (j = 0; j < _PB_NJ; j++)
{
tmp[i][j] = 0;
for (k = 0; k < _PB_NK; ++k)
tmp[i][j] += alpha * A[i][k] * B[k][j];
}
for (i = 0; i < _PB_NI; i++)
for (j = 0; j < _PB_NL; j++)
{
D[i][j] *= beta;
for (k = 0; k < _PB_NJ; ++k)
D[i][j] += tmp[i][k] * C[k][j];
}

i m using following command
$opt -S -O3 -force-vector-width=64 -pass-remarks=loop-vectorize -enable-load-pre=0 2mm.ll -o 2mm-64_o3.ll

what is wrong here? what should i do?

Please help…

It would help if you sent the IR you’re giving to opt or at least a complete C function and your clang command line.

C- Code;

/**

  • 2mm.c: This file is part of the PolyBench/C 3.2 test suite.