[llvm-dev] DiagnosticInfo and SCEV

Alexandre Isoard via llvm-dev llvm-dev at lists.llvm.org
Mon Jun 4 21:33:39 PDT 2018


Ah, yes, I should have provided an example:

1: for(int i = 0; i < n/2; ++i)
2:   for(int j = 0; j < n; ++j)
3:     A[2*i+n*j] += A[2*i+1+n*j];

Let say, I have a loop interchange pass that decide it is better for
spacial locality, to exchange those two loops.
It might print a diagnostic message:

Deciding to perform loop interchange between outer-loop at line 1 and
> inner-loop at line 2. Accesses on A at line 3 have a stride of 2 along the
> outer-loop, which is shorter than the stride of %17 along the inner-loop.


The reason why it says 2 and %17 is because that is the textual
representation of SCEV representing the stride. Ideally, %17 would be
expressed in terms of the original code, here "n". I could translate the
"leaves" into their debug info, but what about {0,+,1}<%loop1> that I would
like to spell, as a block: "i"?

On Mon, Jun 4, 2018 at 8:52 PM, Sanjoy Das <sanjoy at playingwithpointers.com>
wrote:

> On Mon, Jun 4, 2018 at 6:14 PM, Alexandre Isoard via llvm-dev
> <llvm-dev at lists.llvm.org> wrote:
> > - I would like to print meaningful expressions that does not involve
> llvm-ir
> > variables.
>
> I don't quite understand what you mean by this -- are you saying you
> want to print SCEV expressions that have only constants at the leaves?
>
> In any case, some examples will be helpful.
>
> -- Sanjoy
>
> >
> > I think the second problem is hard, how would you suggest to proceed?
> >
> > --
> > Alexandre Isoard
> >
> > _______________________________________________
> > LLVM Developers mailing list
> > llvm-dev at lists.llvm.org
> > http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
> >
>



-- 
*Alexandre Isoard*
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20180604/9ecf9643/attachment.html>


More information about the llvm-dev mailing list