This is the mail archive of the
mailing list for the GCC project.
Re: [PATCH] Fix PR18754: add early loop pass, 2nd try
- From: Richard Guenther <rguenth at tat dot physik dot uni-tuebingen dot de>
- To: Giovanni Bajo <giovannibajo at libero dot it>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Thu, 20 Jan 2005 14:01:35 +0100 (CET)
- Subject: Re: [PATCH] Fix PR18754: add early loop pass, 2nd try
On Thu, 20 Jan 2005, Giovanni Bajo wrote:
> Richard Guenther <email@example.com> wrote:
> >> This patch adds an early loop pass (just after ch) just
> >> containing complete unrolling. This allows the following
> >> SRA pass to scalarize small arrays that were manipulated
> >> in constant rolling loops, as it often happens in C++ code.
> > Merely the same as before, but guarded with -ftree-early-loop-optimize
> > and proper documentation. Disabled by default.
> I'm actually against adding "secret" tree optimizations that only a few people
> know about and use, it gives us some maintenance burden. Can you prove this
> optimization is always useful? How does it affect SPEC? How does it affect
> bootstrap times? How does it affect PR 8361 and POOMA, in both compile-time and
> For instance, if it is a little too expensive we could activate it only at -O3,
> but I can't see numbers (again) supporting this patch.
The main reason for not enabling this by default is that it may interact
badly with vectorization according to Dorit. I'll get you numbers for
PR8361 and POOMA once a disable-checking bootstrap completed (I hit ICE
PR ... err? the one with "XXX addressable but TREE_ADDRESSABLE not set").
I don't have SPEC, but I guess this mainly helps code with "artificial"
loops that are because of code abstraction either via C++ templates or
C macros aka
template <int Dim>
X<Dim> add(const X<Dim>& x, const X<Dim>& y)
for (int i=0; i<Dim; ++i)
res(i) = x(i) + y(i);
as in the case of POOMA and the testcase in PR18754 where I also
posted asm before and after. Or the equivalent with C macros.
Richard Guenther <richard dot guenther at uni-tuebingen dot de>