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

David Blaikie via llvm-dev llvm-dev at lists.llvm.org
Thu Aug 4 08:17:53 PDT 2016


Extracting things like variable names can be done in a best-effort basis by
examining debug info metadata/intrinsics in the LLVM IR - but, as I said,
it's totally best-effort (which is really "not much effort" when it comes
to optimized code) so it may not be present, accurate, etc.

On Wed, Aug 3, 2016 at 10:16 AM Miguel Aguilar via llvm-dev <
llvm-dev at lists.llvm.org> wrote:

> 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
> _______________________________________________
> LLVM Developers mailing list
> llvm-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20160804/a15e9024/attachment.html>


More information about the llvm-dev mailing list