if-conditions

8 views
Skip to first unread message

albert

unread,
Feb 8, 2009, 8:37:24 PM2/8/09
to CLooG
Hi,

I want to parse the loop code generated by CLooG, so I need to know
the structure of the CLooG generated loops, specifically how if-
conditions are generated in the CLooG's output.

Is it true that CLooG won't generate if-conditions if the generated
code is maximally optimized for control (by using -l -1 and -f 1
options)?

What would be the content of the if-condition's test expression? Would
it be always a function of outer loops and global parameters?

Thanks,
-Albert

Uday Kumar Reddy

unread,
Feb 8, 2009, 10:49:32 PM2/8/09
to cl...@googlegroups.com
On Sun, Feb 8, 2009 at 8:37 PM, albert <albert....@gmail.com> wrote:

Hi,

I want to parse the loop code generated by CLooG, so I need to know
the structure of the CLooG generated loops, specifically how if-
conditions are generated in the CLooG's output.

Is it true that CLooG won't generate if-conditions if the generated
code is maximally optimized for control (by using -l -1 and -f 1
options)?

No, there may still be if conditions involving modulos or conditionals involving parameters (context).
 


What would be the content of the if-condition's test expression? Would
it be always a function of outer loops and global parameters?

No. It can involve logical and's, min, max, floor, ceil, and modulos too. Generated conditionals can be equalities or inequalities. The whole conditional can always be translated back into affine constraints though.

          Uday
 


Thanks,
-Albert




albert

unread,
Feb 8, 2009, 11:14:41 PM2/8/09
to CLooG


> > Is it true that CLooG won't generate if-conditions if the generated
> > code is maximally optimized for control (by using -l -1 and -f 1
> > options)?
>
> No, there may still be if conditions involving modulos or conditionals
> involving parameters (context).

Yes, I've seen this before. But is it true that these if-conditions
(involving context parameters) are always outside the outermost loops
(i.e., no if-conditions are nested inside loops)?

Thanks,
--Albert

Sven Verdoolaege

unread,
Feb 9, 2009, 4:35:23 AM2/9/09
to albert, CLooG
On Sun, Feb 08, 2009 at 08:14:41PM -0800, albert wrote:
> Yes, I've seen this before. But is it true that these if-conditions
> (involving context parameters) are always outside the outermost loops
> (i.e., no if-conditions are nested inside loops)?

Certainly not.

skimo

albert

unread,
Feb 9, 2009, 10:33:56 AM2/9/09
to CLooG
Thanks, Sven and Uday. This gives me a very useful understanding about
CLooG's output. I may be back asking questions again. :-)
--Albert
Reply all
Reply to author
Forward
0 new messages