This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

PRE and loop invariants - or: how to wave a dead chicken and get awaywith it.


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]