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 unrolling


Jeffrey A Law wrote:

>   > 2) Determining whether a loop is empty or not needs some kind of
>   >    register lifetime information.  Last I looked, this was not
>   >    reliable at the time of loop unrolling.  If this is no longer true,
>   >    then I can resurrect some code to do this.
> Maybe I misunderstood the kinds of loops people wanted to eliminate.
> I thought if they were empty there was nothing but an increment of
> the counter, and a condjump back to the counter increment.

Generally the kinds of "empty" loops that show up in template 
expansions look something like:

  for (i = 0; i < 0; ++i) *p++ = *q++;

or probably more frequently
   
  for (i = 0; i < 10; ++i, ++p) { if (p); }

Nathan Myers
ncm@cantrip.org


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