[llvm-dev] Extracting the names of the variables that creates loop-carried dependencies

Miguel Aguilar via llvm-dev llvm-dev at lists.llvm.org
Wed Aug 3 10:13:05 PDT 2016


Hi,

I would like to know if it is possible to extract the source level names 
of variables that create loop-carried dependencies.

For example, for the following code:

     for (int i = 0; i < A_ROW; i++)
     {
         for (int j = 1; j < B_COL; j++)
         {
             a_matrix[i][j] = a_matrix[i][j - 1];
         }
     }

I get the following  AST:

       #pragma omp parallel for
       for (int c0 = 0; c0 <= 31; c0 += 1)
         #pragma minimal dependence distance: 1
         for (int c1 = 0; c1 <= 30; c1 += 1)
           Stmt_for_body5(c0, c1);

As expected the second loop has a dependence distance of 1. Then, here 
is when I would like to know if
it possible to extract the name of the variable (a_matrix) e.g. by 
developing a custom LLVM pass, based on
Polly passes.

Thanks,
Miguel


More information about the llvm-dev mailing list