This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: tree-ssa memory and compile-time regressions
> On Thu, 8 Jan 2004, Jan Hubicka wrote:
>
> > > Hi!
> > >
> > > I just tried todays tree-ssa branch (wanting to look at tree-sra and
> > > tree-points-to=andersen) with POOMA and experience problems
> > > getting my application to finish compiling at all...
> > >
> > > Looking at the testcase (stripped down application)
> > > http://www.tat.physik.uni-tuebingen.de/~rguenth/gcc/apressure.ii.gz
> > >
> > > timings are (1GHz Athlon, 1G ram), all with -fno-exceptions:
> > >
> > > -O0 220MB, 0m17s
> > > -O1 260MB, 0m24s
> > > -O2 800MB, 7m35s (-ftime-report on a faster machine attached below)
> > > -O2 -fno-unit-at-a-time 260MB, 0m28s
> >
> > It seems to me that inlining just drives ssa-pre pass crazy.
> > You can take a look into -dU dump, it contains information about what
> > functions get inlinined where and the overall growth.
> > In general the growth shall never exceed 100% so this seems to be either
> > very nonlinear behaviour of something in the size of function or bug in
> > code size estimation.
>
> F.i.
>
> Deciding on smaller functions:
>
> Considering Interval<Dim>::~Interval() [with int Dim = 3] with 0 insns
> Estimated growth is -1390 insns.
> Inlined into EvaluateLocLoop<Forgas::APressure<3>, 3>::~EvaluateLocLoop()
> which now has -10 insns.
> Inlined into INode<Dim>::~INode() [with int Dim = 3] which now has -10
> insns.
> ...
>
> negative code sizes don't look right? So out of zero instruction inline
> we generate -1390 instructions? Here's something wrong. Like (unchecked):
THis should not happen as size of call is 10 and thus the size should
never get negative. I will add abort here and figure out what is going
on.
Honza
>
> Index: cgraphunit.c
> ===================================================================
> RCS file: /cvs/gcc/gcc/gcc/cgraphunit.c,v
> retrieving revision 1.1.4.29
> diff -u -c -3 -r1.1.4.29 cgraphunit.c
> *** cgraphunit.c 4 Jan 2004 15:48:30 -0000 1.1.4.29
> --- cgraphunit.c 8 Jan 2004 15:34:09 -0000
> ***************
> *** 796,802 ****
> cgraph_estimate_size_after_inlining (int times, struct cgraph_node *to,
> struct cgraph_node *what)
> {
> ! return (what->global.insns - INSNS_PER_CALL) * times + to->global.insns;
> }
>
> /* Estimate the growth caused by inlining NODE into all callees. */
> --- 796,803 ----
> cgraph_estimate_size_after_inlining (int times, struct cgraph_node *to,
> struct cgraph_node *what)
> {
> ! int newsize = (what->global.insns - INSNS_PER_CALL) * times + to->global.insns;
> ! return newsize > 0 ? newsize : 0;
> }
>
> /* Estimate the growth caused by inlining NODE into all callees. */