public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* [RFC] Extension of SIMPLE for Fortran 95
@ 2002-06-10  2:32 S. Bosscher
  2002-06-10  6:55 ` Daniel Berlin
                   ` (2 more replies)
  0 siblings, 3 replies; 19+ messages in thread
From: S. Bosscher @ 2002-06-10  2:32 UTC (permalink / raw)
  To: 'gcc@gcc.gnu.org'

Hello,

This weekend we discussed the Fortran CYCLE (eqv. of C 'continue') and EXIT
(eqv. of 'break') statements on the G95 mailing list. In Fortran 95, you can
have:

OUTER:  DO I=...
           ...
   INNER:  DO J=...
              ...
              IF (something) THEN
                 CYCLE OUTER
              ELSE IF (something else) THEN
                 EXIT OUTER
              ENDIF
              ...
           END DO INNER
           ...
            
        END DO OUTER

We want to lower our parse tree to SIMPLE, but we can't represent this kind
of CYCLE and EXIT statements in SIMPLE.

The back end *does* provide functions for expanding break/continue from
nested loops (http://cobolforgcc.sourceforge.net/cobol_14.html#SEC138), but
it seems that only g77 uses these routines to break from an outer loop, or
to continue a nested loop.

So I would like to propose an extension to the SIMPLE grammar:
How about adding an integer argument to the 'continue' and 'break'
statements, that gives how many loops to break or continue from. 'continue'
without argument would be the "normal" continue statement, 'continue 1'
would contine the second-innermost loop, etc.

I don't think this change would require a lot of changes in the existing
code, and it would make SIMPLE a little more language independent. It would
help G95, too ;-)

Sounds OK?

Greetz
Steven

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [RFC] Extension of SIMPLE for Fortran 95
  2002-06-10  2:32 [RFC] Extension of SIMPLE for Fortran 95 S. Bosscher
@ 2002-06-10  6:55 ` Daniel Berlin
  2002-06-10  7:58 ` Diego Novillo
  2002-06-10 20:43 ` Tim Prince
  2 siblings, 0 replies; 19+ messages in thread
From: Daniel Berlin @ 2002-06-10  6:55 UTC (permalink / raw)
  To: S. Bosscher; +Cc: 'gcc@gcc.gnu.org'

>
> I don't think this change would require a lot of changes in the existing
> code, and it would make SIMPLE a little more language independent.

Um, how many changes would it require to break and continue elimination?
See simple-break-elim.c

>  It would
> help G95, too ;-)
>
> Sounds OK?
>
> Greetz
> Steven
>

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [RFC] Extension of SIMPLE for Fortran 95
  2002-06-10  2:32 [RFC] Extension of SIMPLE for Fortran 95 S. Bosscher
  2002-06-10  6:55 ` Daniel Berlin
@ 2002-06-10  7:58 ` Diego Novillo
  2002-06-10  9:20   ` Tom Tromey
  2002-06-10 20:43 ` Tim Prince
  2 siblings, 1 reply; 19+ messages in thread
From: Diego Novillo @ 2002-06-10  7:58 UTC (permalink / raw)
  To: S. Bosscher; +Cc: 'gcc@gcc.gnu.org'

On Mon, 10 Jun 2002, S. Bosscher wrote:

> OUTER:  DO I=...
>            ...
>    INNER:  DO J=...
>               ...
>               IF (something) THEN
>                  CYCLE OUTER
>               ELSE IF (something else) THEN
>                  EXIT OUTER
>               ENDIF
>               ...
>            END DO INNER
>            ...
>             
>         END DO OUTER
> 
> We want to lower our parse tree to SIMPLE, but we can't represent this kind
> of CYCLE and EXIT statements in SIMPLE.
> 
Maybe we shouldn't have to.  Couldn't the above be modelled with
GOTOs?  The way I'd rather handle it is to have the g95
simplifier deal with things like this.

The way to approach this is to think about converting the above
to RTL.  If you can convert to RTL, then you can convert to
SIMPLE.  You merely need to expose all the language-dependent
semantics.


Diego.

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [RFC] Extension of SIMPLE for Fortran 95
  2002-06-10  7:58 ` Diego Novillo
@ 2002-06-10  9:20   ` Tom Tromey
  2002-06-10  9:36     ` Diego Novillo
  0 siblings, 1 reply; 19+ messages in thread
From: Tom Tromey @ 2002-06-10  9:20 UTC (permalink / raw)
  To: Diego Novillo; +Cc: S. Bosscher, 'gcc@gcc.gnu.org'

>>>>> "Diego" == Diego Novillo <dnovillo@redhat.com> writes:

>> We want to lower our parse tree to SIMPLE, but we can't represent this kind
>> of CYCLE and EXIT statements in SIMPLE.

Diego> Maybe we shouldn't have to.  Couldn't the above be modelled
Diego> with GOTOs?  The way I'd rather handle it is to have the g95
Diego> simplifier deal with things like this.

FWIW, Java also has this feature.  I'm curious to know why it is you'd
prefer this be handled using GOTO.  Or to put it another way, why not
handle all continue/break using GOTO?

Tom

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [RFC] Extension of SIMPLE for Fortran 95
  2002-06-10  9:20   ` Tom Tromey
@ 2002-06-10  9:36     ` Diego Novillo
  2002-06-10  9:53       ` Michal Moskal
                         ` (2 more replies)
  0 siblings, 3 replies; 19+ messages in thread
From: Diego Novillo @ 2002-06-10  9:36 UTC (permalink / raw)
  To: Tom Tromey; +Cc: S. Bosscher, 'gcc@gcc.gnu.org'

On Mon, 2002-06-10 at 12:03, Tom Tromey wrote:
> >>>>> "Diego" == Diego Novillo <dnovillo@redhat.com> writes:
> 
> >> We want to lower our parse tree to SIMPLE, but we can't represent this kind
> >> of CYCLE and EXIT statements in SIMPLE.
> 
> Diego> Maybe we shouldn't have to.  Couldn't the above be modelled
> Diego> with GOTOs?  The way I'd rather handle it is to have the g95
> Diego> simplifier deal with things like this.
> 
> FWIW, Java also has this feature.  I'm curious to know why it is you'd
> prefer this be handled using GOTO.
> 
I want to minimize implicit behaviour.  They only create problems when
doing language-independent transformations.


> Or to put it another way, why not handle all continue/break using GOTO?
>
I can only give you one pretty weak reason: the original SIMPLE grammar
allows them.  I wouldn't mind handling them using GOTO statements.


Diego.

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [RFC] Extension of SIMPLE for Fortran 95
  2002-06-10  9:36     ` Diego Novillo
@ 2002-06-10  9:53       ` Michal Moskal
  2002-06-10 10:07         ` Diego Novillo
  2002-06-10  9:58       ` Daniel Berlin
  2002-06-10 10:16       ` Steven Bosscher
  2 siblings, 1 reply; 19+ messages in thread
From: Michal Moskal @ 2002-06-10  9:53 UTC (permalink / raw)
  To: Diego Novillo; +Cc: gcc

On Mon, Jun 10, 2002 at 12:20:42PM -0400, Diego Novillo wrote:
> On Mon, 2002-06-10 at 12:03, Tom Tromey wrote:
> > Or to put it another way, why not handle all continue/break using GOTO?
> >
> I can only give you one pretty weak reason: the original SIMPLE grammar
> allows them.  I wouldn't mind handling them using GOTO statements.

So remove them (break & continue). It will save you questions like:
which one is more efficient, so should I check if, in my language,
`break foobar' break inner or outer loop so I should use break or
goto?

-- 
: Michal Moskal ::::: malekith/at/pld-linux.org :  GCS {C,UL}++++$ a? !tv
: PLD Linux ::::::: Wroclaw University, CS Dept :  {E-,w}-- {b++,e}>+++ h

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [RFC] Extension of SIMPLE for Fortran 95
  2002-06-10  9:36     ` Diego Novillo
  2002-06-10  9:53       ` Michal Moskal
@ 2002-06-10  9:58       ` Daniel Berlin
  2002-06-10 10:19         ` Diego Novillo
  2002-06-10 10:16       ` Steven Bosscher
  2 siblings, 1 reply; 19+ messages in thread
From: Daniel Berlin @ 2002-06-10  9:58 UTC (permalink / raw)
  To: Diego Novillo; +Cc: Tom Tromey, S. Bosscher, 'gcc@gcc.gnu.org'

On 10 Jun 2002, Diego Novillo wrote:

> On Mon, 2002-06-10 at 12:03, Tom Tromey wrote:
> > >>>>> "Diego" == Diego Novillo <dnovillo@redhat.com> writes:
> > 
> > >> We want to lower our parse tree to SIMPLE, but we can't represent this kind
> > >> of CYCLE and EXIT statements in SIMPLE.
> > 
> > Diego> Maybe we shouldn't have to.  Couldn't the above be modelled
> > Diego> with GOTOs?  The way I'd rather handle it is to have the g95
> > Diego> simplifier deal with things like this.
> > 
> > FWIW, Java also has this feature.  I'm curious to know why it is you'd
> > prefer this be handled using GOTO.
> > 
> I want to minimize implicit behaviour.  They only create problems when
> doing language-independent transformations.
For reference, i know of two java optimizers that handle this by creating 
explicit gotos (and then they use goto elimination, but that's a side 
issue).

> 
> 
> > Or to put it another way, why not handle all continue/break using GOTO?
> >
> I can only give you one pretty weak reason: the original SIMPLE grammar
> allows them.  I wouldn't mind handling them using GOTO statements.

For a point of reference, as i showed Diego, intel's compiler transforms 
all continue/break to goto before anything gets ahold of it.
 Then again, they also transform all for loops to whiles, and then the 
whiles to if/gotos.

example:

int main(void)
{
        int i;
        for (i = 0; i < 50; i++)
        {
                continue;
        }
}

---- (proton/phase2/csi_not.c:251, List number: 1) Graph before COMPLEX_Lower_Il
0:
2       0           entry extern main_V$0  main
                    {
4       2               i_1_V$1 = 0(SI32);
4       5               while ( i_1_V$1 < 50(SI32) )
                        {
6       3                   goto L1;
8       1           L1:
4       4                   i_1_V$1 = i_1_V$1 + 1(SI32);
                        }
8       6               return ( 0(SI32) );
8       7               return ;
                    }


---- (proton/phase2/csi_not.c:259, List number: 2) Graph before Lower:
2       0           entry extern main_V$0  main
                    {
4       2               i_1_V$1 = 0(SI32);
4       5               while ( i_1_V$1 < 50(SI32) )
                        {
6       3                   goto L1;
8       1           L1:
4       4                   i_1_V$1 = i_1_V$1 + 1(SI32);
                        }
8       6               return ( 0(SI32) );
8       7               return ;
                    }


---- (proton/phase2/csi_not.c:279, List number: 3) Graph after Lower:
2       0           entry extern main_V$0  main
                    {
4       2               i_1_V$1 = 0(SI32);
4       10          L10:
4       8               if ( i_1_V$1 < 50(SI32) )
                        {
6       3                   goto L1;
8       1           L1:
4       4                   i_1_V$1 = i_1_V$1 + 1(SI32);
4       9                   goto L10;
                        }
8       6               return ( 0(SI32) );
8       7               return ;
                    }


> 
> 
> Diego.
> 
> 
> 

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [RFC] Extension of SIMPLE for Fortran 95
  2002-06-10  9:53       ` Michal Moskal
@ 2002-06-10 10:07         ` Diego Novillo
  0 siblings, 0 replies; 19+ messages in thread
From: Diego Novillo @ 2002-06-10 10:07 UTC (permalink / raw)
  To: Michal Moskal; +Cc: gcc

On Mon, 2002-06-10 at 12:34, Michal Moskal wrote:
> On Mon, Jun 10, 2002 at 12:20:42PM -0400, Diego Novillo wrote:
> > On Mon, 2002-06-10 at 12:03, Tom Tromey wrote:
> > > Or to put it another way, why not handle all continue/break using GOTO?
> > >
> > I can only give you one pretty weak reason: the original SIMPLE grammar
> > allows them.  I wouldn't mind handling them using GOTO statements.
> 
> So remove them (break & continue). It will save you questions like:
> which one is more efficient, so should I check if, in my language,
> `break foobar' break inner or outer loop so I should use break or
> goto?
> 
As usual, patches welcome.  The issue still hasn't piqued my interest
and it will be mildly annoying to change the simplifier and the
flowgraph builder.


Diego.

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [RFC] Extension of SIMPLE for Fortran 95
  2002-06-10  9:36     ` Diego Novillo
  2002-06-10  9:53       ` Michal Moskal
  2002-06-10  9:58       ` Daniel Berlin
@ 2002-06-10 10:16       ` Steven Bosscher
  2 siblings, 0 replies; 19+ messages in thread
From: Steven Bosscher @ 2002-06-10 10:16 UTC (permalink / raw)
  To: Diego Novillo; +Cc: Tom Tromey, 'gcc@gcc.gnu.org'

Op ma 10-06-2002, om 18:20 schreef Diego Novillo:
> On Mon, 2002-06-10 at 12:03, Tom Tromey wrote:
---- 8< ----
> > Or to put it another way, why not handle all continue/break using GOTO?
> >
> I can only give you one pretty weak reason: the original SIMPLE grammar
> allows them.  I wouldn't mind handling them using GOTO statements.
> 
> 
> Diego.

The reason why the SIMPLE grammar has break and continue is mentioned in
many papers about the McCat compiler. To pick one of them, from "A
Goto-Elimination Method And Its Implementation For The McCat Compiler"
(Erosa, 1995, 2 citations):

"Another important point is that we have chosen to directly support
break and continue statements. Even though these statements represent a
form of control flow similar to gotos, they can be easily handled by our
structured data flow analysis 6 methods [Sri92, Ema93] Break and
continue statements do not change the controlflow of the programs
outside the scope of the closest enclosing loop structure. In this sense
the program remains compositional, the meaning of the program structure
is given by the meaning of its components."

I have to admit, though, that this may not be very relevant for GCC...

Greetz
Steven


^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [RFC] Extension of SIMPLE for Fortran 95
  2002-06-10  9:58       ` Daniel Berlin
@ 2002-06-10 10:19         ` Diego Novillo
  2002-06-10 10:29           ` Daniel Berlin
  0 siblings, 1 reply; 19+ messages in thread
From: Diego Novillo @ 2002-06-10 10:19 UTC (permalink / raw)
  To: Daniel Berlin; +Cc: Tom Tromey, S. Bosscher, 'gcc@gcc.gnu.org'

On Mon, 2002-06-10 at 12:52, Daniel Berlin wrote:

> Then again, they also transform all for loops to whiles, and then the 
> whiles to if/gotos.
> 
This also comes up every now and again.  Coalescing loop constructs into
a single loop representation.  In principle, I would like to maintain at
least FOR_STMT to facilitate high-level loop transformations (known
bounds, controlling loop variable easy to spot).  In fact, I'd like to
have a pass to canonicalize DO_STMT and WHILE_STMT into FOR_STMTs
whenever possible.

I intend to delay these decisions until we start building loop
transformations.


Diego.

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [RFC] Extension of SIMPLE for Fortran 95
  2002-06-10 10:19         ` Diego Novillo
@ 2002-06-10 10:29           ` Daniel Berlin
  0 siblings, 0 replies; 19+ messages in thread
From: Daniel Berlin @ 2002-06-10 10:29 UTC (permalink / raw)
  To: Diego Novillo; +Cc: Tom Tromey, S. Bosscher, 'gcc@gcc.gnu.org'


On Monday, June 10, 2002, at 01:16  PM, Diego Novillo wrote:

> On Mon, 2002-06-10 at 12:52, Daniel Berlin wrote:
>
>> Then again, they also transform all for loops to whiles, and then the
>> whiles to if/gotos.
>>
> This also comes up every now and again.  Coalescing loop constructs into
> a single loop representation.  In principle, I would like to maintain at
> least FOR_STMT to facilitate high-level loop transformations (known
> bounds, controlling loop variable easy to spot).  In fact, I'd like to
> have a pass to canonicalize DO_STMT and WHILE_STMT into FOR_STMTs
> whenever possible.
I agree.
Did I mention the cuter part, that the IA-64 compiler actually rebuilds while loops from the if's/goto's about half way through optimization passes?
(The IA32 compiler doesn't).

>
> I intend to delay these decisions until we start building loop
> transformations.


>
> Diego.
>
>

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [RFC] Extension of SIMPLE for Fortran 95
  2002-06-10  2:32 [RFC] Extension of SIMPLE for Fortran 95 S. Bosscher
  2002-06-10  6:55 ` Daniel Berlin
  2002-06-10  7:58 ` Diego Novillo
@ 2002-06-10 20:43 ` Tim Prince
  2002-06-10 22:39   ` Richard Henderson
  2 siblings, 1 reply; 19+ messages in thread
From: Tim Prince @ 2002-06-10 20:43 UTC (permalink / raw)
  To: S. Bosscher, 'gcc@gcc.gnu.org'

On Monday 10 June 2002 02:14, S. Bosscher wrote:
> Hello,
>
> This weekend we discussed the Fortran CYCLE (eqv. of C 'continue') and EXIT
> (eqv. of 'break') statements on the G95 mailing list. In Fortran 95, you
> can have:
>
> OUTER:  DO I=...
>            ...
>    INNER:  DO J=...
>               ...
>               IF (something) THEN
>                  CYCLE OUTER
>               ELSE IF (something else) THEN
>                  EXIT OUTER
>               ENDIF
>               ...
>            END DO INNER
>            ...
>
>         END DO OUTER
>
> We want to lower our parse tree to SIMPLE, but we can't represent this kind
> of CYCLE and EXIT statements in SIMPLE.
>
> The back end *does* provide functions for expanding break/continue from
> nested loops (http://cobolforgcc.sourceforge.net/cobol_14.html#SEC138), but
> it seems that only g77 uses these routines to break from an outer loop, or
> to continue a nested loop.
>
> So I would like to propose an extension to the SIMPLE grammar:
> How about adding an integer argument to the 'continue' and 'break'
> statements, that gives how many loops to break or continue from. 'continue'
> without argument would be the "normal" continue statement, 'continue 1'
> would contine the second-innermost loop, etc.
>
> I don't think this change would require a lot of changes in the existing
> code, and it would make SIMPLE a little more language independent. It would
> help G95, too ;-)
>
> Sounds OK?
>
> Greetz
> Steven
I understand the motivation for this, and it should fit in with my automatic 
pretty-formatting system, but I have doubts about adding extensions to g77 
(or g95) which aren't covered by the Fortran standard.  
-- 
Tim Prince

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [RFC] Extension of SIMPLE for Fortran 95
  2002-06-10 20:43 ` Tim Prince
@ 2002-06-10 22:39   ` Richard Henderson
  2002-06-11  3:58     ` Jan Hubicka
  2002-06-14  8:44     ` Diego Novillo
  0 siblings, 2 replies; 19+ messages in thread
From: Richard Henderson @ 2002-06-10 22:39 UTC (permalink / raw)
  To: Tim Prince; +Cc: S. Bosscher, 'gcc@gcc.gnu.org'

> On Monday 10 June 2002 02:14, S. Bosscher wrote:
> > So I would like to propose an extension to the SIMPLE grammar:
> > How about adding an integer argument to the 'continue' and 'break'
> > statements, that gives how many loops to break or continue from. 'continue'
> > without argument would be the "normal" continue statement, 'continue 1'
> > would contine the second-innermost loop, etc.

Supposing that Diego doesn't decide to remove break entirely,
I suggest not using a number, but rather have the break/continue
reference the tree node for the loop directly.


r~

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [RFC] Extension of SIMPLE for Fortran 95
  2002-06-10 22:39   ` Richard Henderson
@ 2002-06-11  3:58     ` Jan Hubicka
  2002-06-11  6:04       ` Diego Novillo
  2002-06-14  8:44     ` Diego Novillo
  1 sibling, 1 reply; 19+ messages in thread
From: Jan Hubicka @ 2002-06-11  3:58 UTC (permalink / raw)
  To: Richard Henderson, Tim Prince, S. Bosscher, 'gcc@gcc.gnu.org'

> > On Monday 10 June 2002 02:14, S. Bosscher wrote:
> > > So I would like to propose an extension to the SIMPLE grammar:
> > > How about adding an integer argument to the 'continue' and 'break'
> > > statements, that gives how many loops to break or continue from. 'continue'
> > > without argument would be the "normal" continue statement, 'continue 1'
> > > would contine the second-innermost loop, etc.
> 
> Supposing that Diego doesn't decide to remove break entirely,

Isn't this done already?  I think the simpleyfing pass already
canonicalizes loop to break/continue less forms.

Honza
> I suggest not using a number, but rather have the break/continue
> reference the tree node for the loop directly.
> 
> 
> r~

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [RFC] Extension of SIMPLE for Fortran 95
  2002-06-11  3:58     ` Jan Hubicka
@ 2002-06-11  6:04       ` Diego Novillo
  2002-06-11  6:59         ` Jan Hubicka
  0 siblings, 1 reply; 19+ messages in thread
From: Diego Novillo @ 2002-06-11  6:04 UTC (permalink / raw)
  To: Jan Hubicka
  Cc: Richard Henderson, Tim Prince, S. Bosscher, 'gcc@gcc.gnu.org'

On Tue, 2002-06-11 at 06:38, Jan Hubicka wrote:
> > > On Monday 10 June 2002 02:14, S. Bosscher wrote:
> > > > So I would like to propose an extension to the SIMPLE grammar:
> > > > How about adding an integer argument to the 'continue' and 'break'
> > > > statements, that gives how many loops to break or continue from. 'continue'
> > > > without argument would be the "normal" continue statement, 'continue 1'
> > > > would contine the second-innermost loop, etc.
> > 
> > Supposing that Diego doesn't decide to remove break entirely,
> 
> Isn't this done already?  I think the simpleyfing pass already
> canonicalizes loop to break/continue less forms.
> 
No.  There are two separate passes that deal with this.  But they are
not enabled by default.


Diego.

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [RFC] Extension of SIMPLE for Fortran 95
  2002-06-11  6:04       ` Diego Novillo
@ 2002-06-11  6:59         ` Jan Hubicka
  2002-06-11  7:53           ` Diego Novillo
  0 siblings, 1 reply; 19+ messages in thread
From: Jan Hubicka @ 2002-06-11  6:59 UTC (permalink / raw)
  To: Diego Novillo
  Cc: Jan Hubicka, Richard Henderson, Tim Prince, S. Bosscher,
	'gcc@gcc.gnu.org'

> On Tue, 2002-06-11 at 06:38, Jan Hubicka wrote:
> > > > On Monday 10 June 2002 02:14, S. Bosscher wrote:
> > > > > So I would like to propose an extension to the SIMPLE grammar:
> > > > > How about adding an integer argument to the 'continue' and 'break'
> > > > > statements, that gives how many loops to break or continue from. 'continue'
> > > > > without argument would be the "normal" continue statement, 'continue 1'
> > > > > would contine the second-innermost loop, etc.
> > > 
> > > Supposing that Diego doesn't decide to remove break entirely,
> > 
> > Isn't this done already?  I think the simpleyfing pass already
> > canonicalizes loop to break/continue less forms.
> > 
> No.  There are two separate passes that deal with this.  But they are
> not enabled by default.

What are the consequences on code size/perfomrance of enabling these
bits?  I am always running into performance problems when I implement
some idea of reugualizing CFG on RTL level...

Honza
> 
> 
> Diego.

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [RFC] Extension of SIMPLE for Fortran 95
  2002-06-11  6:59         ` Jan Hubicka
@ 2002-06-11  7:53           ` Diego Novillo
  0 siblings, 0 replies; 19+ messages in thread
From: Diego Novillo @ 2002-06-11  7:53 UTC (permalink / raw)
  To: Jan Hubicka
  Cc: Richard Henderson, Tim Prince, S. Bosscher, 'gcc@gcc.gnu.org'

On Tue, 2002-06-11 at 09:50, Jan Hubicka wrote:

> What are the consequences on code size/perfomrance of enabling these
> bits?  I am always running into performance problems when I implement
> some idea of reugualizing CFG on RTL level...
> 
Dunno.  I haven't done any testing on these passes.  Sebastian mentioned
code growth, but I don't know of any systematic testing.

Diego.

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [RFC] Extension of SIMPLE for Fortran 95
  2002-06-10 22:39   ` Richard Henderson
  2002-06-11  3:58     ` Jan Hubicka
@ 2002-06-14  8:44     ` Diego Novillo
  1 sibling, 0 replies; 19+ messages in thread
From: Diego Novillo @ 2002-06-14  8:44 UTC (permalink / raw)
  To: Richard Henderson; +Cc: Tim Prince, S. Bosscher, 'gcc@gcc.gnu.org'

On Tue, 2002-06-11 at 00:10, Richard Henderson wrote:
> > On Monday 10 June 2002 02:14, S. Bosscher wrote:
> > > So I would like to propose an extension to the SIMPLE grammar:
> > > How about adding an integer argument to the 'continue' and 'break'
> > > statements, that gives how many loops to break or continue from. 'continue'
> > > without argument would be the "normal" continue statement, 'continue 1'
> > > would contine the second-innermost loop, etc.
> 
> Supposing that Diego doesn't decide to remove break entirely,
> I suggest not using a number, but rather have the break/continue
> reference the tree node for the loop directly.
> 
Well, the breaking block has the exit edge pointing to the proper exit
node.  Also, basic blocks know who their control parent is.  That should
be enough info for the analysis routines.

Continue blocks are similarly handled, they point back to their loop
parent.  There are also routines to query control parents and
continue/exit points.

Diego.

^ permalink raw reply	[flat|nested] 19+ messages in thread

* RE: [RFC] Extension of SIMPLE for Fortran 95
@ 2002-06-11  5:48 S. Bosscher
  0 siblings, 0 replies; 19+ messages in thread
From: S. Bosscher @ 2002-06-11  5:48 UTC (permalink / raw)
  To: 'Jan Hubicka ', 'Richard Henderson ',
	'Tim Prince ', 'S. Bosscher ',
	''gcc@gcc.gnu.org' '

> > Supposing that Diego doesn't decide to remove break entirely,
> 
> Isn't this done already?  I think the simpleyfing pass already
> canonicalizes loop to break/continue less forms.

A goto/break elimination pass has been implemented by Sebastian Pop,
but it was still '#if 0'-ed out last time I looked.

Greetz
Steven

^ permalink raw reply	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2002-06-14 15:29 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-06-10  2:32 [RFC] Extension of SIMPLE for Fortran 95 S. Bosscher
2002-06-10  6:55 ` Daniel Berlin
2002-06-10  7:58 ` Diego Novillo
2002-06-10  9:20   ` Tom Tromey
2002-06-10  9:36     ` Diego Novillo
2002-06-10  9:53       ` Michal Moskal
2002-06-10 10:07         ` Diego Novillo
2002-06-10  9:58       ` Daniel Berlin
2002-06-10 10:19         ` Diego Novillo
2002-06-10 10:29           ` Daniel Berlin
2002-06-10 10:16       ` Steven Bosscher
2002-06-10 20:43 ` Tim Prince
2002-06-10 22:39   ` Richard Henderson
2002-06-11  3:58     ` Jan Hubicka
2002-06-11  6:04       ` Diego Novillo
2002-06-11  6:59         ` Jan Hubicka
2002-06-11  7:53           ` Diego Novillo
2002-06-14  8:44     ` Diego Novillo
2002-06-11  5:48 S. Bosscher

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).