This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
PRE and loop invariants - or: how to wave a dead chicken and get awaywith it.
- To: law at cygnus dot com
- Subject: PRE and loop invariants - or: how to wave a dead chicken and get awaywith it.
- From: Toon Moene <toon at moene dot indiv dot nluug dot nl>
- Date: Sat, 23 May 98 21:31:12 +0200
- Cc: egcs at cygnus dot com
- Organization: Moene Computational Physics, Maartensdijk, The Netherlands
- References: <22552.895950132@hurl.cygnus.com>
[ Changed the subject to something more appropriate ]
[ ... No visible impact of GCSE on my Fortran code ... ]
> I didn't mention it, but loop invariant code motion is
> a subcase of partial redundancy elimination :-)
> If you think about it for a while you'll realize that
> evaluating a loop invariant is a redundant evaluation on
> a particular path (the path that loops). PRE treats it
> just like any other redundant expression.
But in what sense it's redundant (assuming no loop unrolling for
the moment) ? Before you move the invariant, there's only the
expression inside the loop; after you've moved it, there's the same
expression outside the loop and the register containing its value
referenced inside the loop. I don't see any redundancy here (I only
see a twisty maze of DAGs, all slightly different).
> In fact, that's accounted for most of the benefits of
> gcse for Fortran in the benchmarks I've run.
Strange - why don't I see that benefit then ?
Cheers,
Toon.