public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* Re: optimization
@ 2003-12-09 18:18 Benjamin Kosnik
  0 siblings, 0 replies; 21+ messages in thread
From: Benjamin Kosnik @ 2003-12-09 18:18 UTC (permalink / raw)
  To: gcc; +Cc: viktor.przebinda

> optimization that would have its greatest impact on scientific code written in C++. 

Do you have any specifics? I imagine it would be pretty easy to find
interest for this project. I'd suggest that you come up with a detailed
proposal and post it on this list for comment. You may be interested in
the tree-SSA infrastructure, see:
http://gcc.gnu.org/projects/tree-ssa/

However, if you are just looking for suggestions, there are a number of
C++ scientific libraries that would be interested in increasing
performance, some of which are listed below.

- ginac (symbolic algebra)
  http://www.ginac.de/
- pooma (parallel scientific computation)
  http://www.codesourcery.com/pooma/pooma
- goose (stats)
  http://www.gnu.org/software/goose/goose.html
- itk (algo parts)
  http://www.itk.org

A first step might be doing performance analysis of these libraries,
finding bottlenecks, and then working to resolve these deficiencies.

There are, or have been, issues with performance of C++'s complex type.
Perhaps Joe Buck could give more information on this.

There are people on this list (or gcc developers) that seem to be
interested in this subject. Off the top of my head, these people include
Roger Sayle, Scott Synder, Scott Robert Ladd, Gabriel Dos Reis, etc. I'm
sure there are others.

good luck,
-benjamin

^ permalink raw reply	[flat|nested] 21+ messages in thread
* optimization
@ 2003-12-09 16:42 Viktor Przebinda
  2003-12-09 17:29 ` optimization Diego Novillo
  2003-12-09 18:53 ` optimization Scott Robert Ladd
  0 siblings, 2 replies; 21+ messages in thread
From: Viktor Przebinda @ 2003-12-09 16:42 UTC (permalink / raw)
  To: gcc

I am interested in doing a long term (1.5 years) project with g++ 
related to optimization for a masters thesis in computer engineering. 
More specifically, optimization that would have its greatest impact on 
scientific code written in C++. Target platform could be either PowerPC 
or x86. I have already looked at gcc's website on the subject of 
optimization deficiencies without much luck. These projects either 
seemed too small or not related to scientific computing applications. 
If anyone has some ideas please let me know.

Viktor
viktor.przebinda@colorado.edu 

^ permalink raw reply	[flat|nested] 21+ messages in thread
* Optimization
@ 2003-05-02 12:05 Piotr Wyderski
  2003-05-02 23:08 ` Optimization Richard Henderson
  0 siblings, 1 reply; 21+ messages in thread
From: Piotr Wyderski @ 2003-05-02 12:05 UTC (permalink / raw)
  To: gcc

Hello,

I've just looked at the binary code produced by the GCC 3.2
C++ compiler and don't understand your new optimizer's
behaviour. Why don't you optimize the "jump to ret" construction?
I mean this:

    if (b)
        C;
    else
        D;

produces:

    cmp/test b
    je    L2
    C
L1:    ret

L2:  D
    jmp L1

instead of:

    cmp/test b
    je     L2
    C
    ret

L2:  D
    ret

I see that there's also a greedy stack frame allocator instead
of a lazy one. Using the previous example

    if (b)
        C;
    else
        D;

when C is short and can be computed using only the scratch
registers, i.e. eax, edx and ecx, and D is complex and needs
to save/restore the remaining GP registers, GCC generates:

    push max_register_usage(C,D);
    test b
    je L2
    C

L1:   pop max_register_usage(C,D);
    ret

L2: D
    jmp L1,

but it could do this:

    test b
    je L2
    C
    ret

L2:    push register_usage(D);
    D
    pop register_usage(D);
    ret

    Best regards
    Piotr Wyderski



Zobacz nasz nowy serwis - wczasy za granicą - http://hoga.travelplanet.pl/
------------------------------------------------------------
Wiosną wirusy rosną bez pamięci!dlatego do pakietów wielostanowiskowych
mks_vir dokładamy Mobile Disks. Sprawdź:
http://www.mks.com.pl/promocja-mobile.html

^ permalink raw reply	[flat|nested] 21+ messages in thread
* Optimization
@ 2000-05-11 11:21 Thomas, Robert S
  2000-05-11 11:31 ` Optimization Jeffrey A Law
  0 siblings, 1 reply; 21+ messages in thread
From: Thomas, Robert S @ 2000-05-11 11:21 UTC (permalink / raw)
  To: 'gcc@gcc.gnu.org'

Hello,	
	Can you help shed some light as to what exactly -fcombine_statics
optimization flag does?

We are using 2.7.2 and when we compile optimized (-O3) we get an internal
compiler error.  If this flag is removed everything compiled fine.  

We need to justify removing this flag from the compile line however we are
unclear as to what we are actually losing by doing so.

Any insight would be great

Thanks
Rob

robert.s.thomas@lmco.com

^ permalink raw reply	[flat|nested] 21+ messages in thread
* Re: Optimization
@ 1999-03-30  5:07 Oskar Enoksson
  1999-03-31 23:46 ` Optimization Oskar Enoksson
  0 siblings, 1 reply; 21+ messages in thread
From: Oskar Enoksson @ 1999-03-30  5:07 UTC (permalink / raw)
  To: law; +Cc: egcs

> An FYI -- current development snapshots perform this optimization and
> thus egcs-1.2 will perform this optimization when released.
> 
> This optimization was made possible by Mark Mitchell's type based alias
> analysis will allows the compiler to realize that the floating point
> stores in the loop can not access the same memory as the integer loads
> that were initially in the loop.  This exposes the integer loads to loop
> invariant code motion optimizations.

Yes, I'm following the development of egcs closely and I'm currently using
different snapshots on SGI Octane, DEC alpha, and a Linux PC-cluster. The
efficiency for numerical computations is very good now, and I'm looking
forward to a version 1.2 stable on all platforms.

Thank you very much for your efforts!

Regards
/Oskar Enoksson

^ permalink raw reply	[flat|nested] 21+ messages in thread
* Optimization
@ 1998-03-29  5:14 Oskar Enoksson
  1998-04-02  3:41 ` Optimization John Carr
                   ` (4 more replies)
  0 siblings, 5 replies; 21+ messages in thread
From: Oskar Enoksson @ 1998-03-29  5:14 UTC (permalink / raw)
  To: egcs

Hi! I'm working with computational mathematics using c and c++.

Does g++/gcc have any optimization that brings out constant subexpressions
outside loops? Consider the following:

void sqr(float *x, int *step) {
  int i,j,k;

  for (i=0; i<100; i++)
    for (j=0; j<100; j++)
      for (k=0; k<100; k++)
        *(x+i*step[2]+j*step[1]+k*step[0]) *= 
          *(x+i*step[2]+j*step[1]+k*step[0]);
}

The resulting assembler with egcs 1.0.2 (i686-pc-linux-gnulibc1) is not
very efficient, because the integer expressions are calculated again
and again inside the innermost loop. Can I make the compiler translate the
above code into something like the following:

void sqr(float *x, int *step) {
  int i,j,k; 
  float *xi,*xj;

  for (i=0; i<100; i++) {
    xi=x+i*step[2];
    for (j=0; j<100; j++)  {
      xj=xi+j*step[1];
      for (k=0; k<100; k++)  {
        *(xj+k*step[0]) *=
          *(xj+k*step[0]);
      }
    }
  }
}

If this is impossible with the current version, would it be hard to
add this optimization to the compiler? The resulting assembler is much
more efficient.

/Oskar


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

end of thread, other threads:[~2003-12-09 18:18 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-12-09 18:18 optimization Benjamin Kosnik
  -- strict thread matches above, loose matches on Subject: below --
2003-12-09 16:42 optimization Viktor Przebinda
2003-12-09 17:29 ` optimization Diego Novillo
2003-12-09 18:53 ` optimization Scott Robert Ladd
2003-05-02 12:05 Optimization Piotr Wyderski
2003-05-02 23:08 ` Optimization Richard Henderson
2003-05-03  0:12   ` Optimization Andrew Pinski
2003-05-03  1:14     ` Optimization Richard Henderson
2000-05-11 11:21 Optimization Thomas, Robert S
2000-05-11 11:31 ` Optimization Jeffrey A Law
1999-03-30  5:07 Optimization Oskar Enoksson
1999-03-31 23:46 ` Optimization Oskar Enoksson
1998-03-29  5:14 Optimization Oskar Enoksson
1998-04-02  3:41 ` Optimization John Carr
1998-04-02  8:21 ` Optimization Jeffrey A Law
1998-04-02 11:32 ` Optimization Jim Wilson
1998-04-02  3:41   ` Optimization Oskar Enoksson
1998-04-03 21:52     ` Optimization John Carr
1998-04-02 11:32 ` Optimization Joern Rennecke
1999-03-29  8:18 ` Optimization Jeffrey A Law
1999-03-31 23:46   ` Optimization Jeffrey A Law

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).