the loop structure generated by CLooG

7 views
Skip to first unread message

albert

unread,
Feb 7, 2009, 6:09:40 PM2/7/09
to CLooG
Hello,

Can someone please tell me the formats of the loops generated by
CLooG?

As far as I know, CLooG always generates a loop using the following
format:

for (i=LB; i<=UB; i++)
...

or

for (i=LB; i<=UB; i+=ST)
...

LB and UB are the lower and the upper bounds (can be any affine
expressions). ST is the loop stride and is always a positive integer.

I don't know if CLooG can generate a loop like this:

for (i=LB; i>=UB; i--)
...

or

for (i=LB; i>=UB; i-=ST)
...

Or maybe CLooG uses other loop formats that I'm unaware of?

Thanks,
-Albert

Sven Verdoolaege

unread,
Feb 7, 2009, 6:54:03 PM2/7/09
to albert, CLooG
On Sat, Feb 07, 2009 at 03:09:40PM -0800, albert wrote:
>
> Hello,
>
> Can someone please tell me the formats of the loops generated by
> CLooG?

Why do you want to know?

> I don't know if CLooG can generate a loop like this:
>
> for (i=LB; i>=UB; i--)
> ...
>
> or
>
> for (i=LB; i>=UB; i-=ST)
> ...
>

CLooG won't do this (currently).
Would you want it to?

> Or maybe CLooG uses other loop formats that I'm unaware of?

Well, as you know, CLooG may write out some loops as
if-conditions.

skimo

albert

unread,
Feb 7, 2009, 8:00:42 PM2/7/09
to CLooG
Thanks for confirming this. :-)

I'm using CLooG-generated loops as input to my tool. So if CLooG never
generates loops with negative loop strides, my tool won't need to
consider such a case.

Thank you, Sven.

--Albert

Uday Kumar Reddy

unread,
Feb 8, 2009, 1:28:52 AM2/8/09
to cl...@googlegroups.com
On Sat, Feb 7, 2009 at 6:09 PM, albert <albert....@gmail.com> wrote:

Hello,

Can someone please tell me the formats of the loops generated by
CLooG?

The lower (and upper) bounds, if not affine functions of outer loop variables and parameters, can be a max (or min in case of upper bounds) of a sequence of expressions. Each expression in turn can be a max (or min in case of upper) of expressions. A leaf expression can be an affine function of outer loop variables/params or a ceil of an affine function  w.r.t a constant (floor in case of upper bound).
 


As far as I know, CLooG always generates a loop using the following
format:

 for (i=LB; i<=UB; i++)
  ...

 or

 for (i=LB; i<=UB; i+=ST)
  ...

LB and UB are the lower and the upper bounds (can be any affine
expressions). ST is the loop stride and is always a positive integer.

I don't know if CLooG can generate a loop like this:

 for (i=LB; i>=UB; i--)
  ...

 or

 for (i=LB; i>=UB; i-=ST)
  ...

No, it doesn't.

Uday

Uday Kumar Reddy

unread,
Feb 8, 2009, 1:38:38 AM2/8/09
to cl...@googlegroups.com
On Sun, Feb 8, 2009 at 1:28 AM, Uday Kumar Reddy <uday...@gmail.com> wrote:


On Sat, Feb 7, 2009 at 6:09 PM, albert <albert....@gmail.com> wrote:

Hello,

Can someone please tell me the formats of the loops generated by
CLooG?

The lower (and upper) bounds, if not affine functions of outer loop variables and parameters, can be a max (or min in case of upper bounds) of a sequence of expressions. Each expression in turn

Sorry, I meant max of (two) expressions.
 

albert

unread,
Feb 8, 2009, 1:44:20 AM2/8/09
to CLooG
It's very clear to me now. Thanks a lot for the explanation, Uday! :-)
-Albert

On Feb 8, 1:38 am, Uday Kumar Reddy <udayre...@gmail.com> wrote:
> On Sun, Feb 8, 2009 at 1:28 AM, Uday Kumar Reddy <udayre...@gmail.com>wrote:
Reply all
Reply to author
Forward
0 new messages