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]

Re: Loop optimiser upgrade (Was RFC: BB duplication code)


Hi,
another simple question - what notion of loop we want to base our optimizer
on?  The natural loops itself are probably not best choice, as in case of
following loop

for (i=0; i<1000;i++)
  if (i&1)
    do something;
  else
    do something else;

will result in two natural loop each iterating exactly once.  Do you have
some plans about that?  We can merge the loops based on profile data,
probably - the compaq compiler unsplits each such shared header to common
and uncommon one causing two nested loops.

Will we work on multiple loops, or split the header to get common latch
and thus one natural loop from both?

Whats about the notion of superblock loops - the impact compiler is doing some
optimizations only on these and thus they are easier to implement.  With my
tracer code, hot paths of most of internal loops should convert to superblocks,
but still this can be somewhat limited, as too much can fall outside the loop
notion...

Just ideas...
Honza


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