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: Multiple cse and loop opts



In message <16395.915944903@hurl.cygnus.com>, Jeffrey A Law writes:
>
>  In message <199901100425.WAA32150@isua5.iastate.edu>you write:
>  > 
>  >   Are there any bad consequences of adding a second loop optimization
>  > followed by a third CSE pass, other than increase in compilation time?
>  > I have been playing with two loops under egcs v1.1.1 that look like
>  > these:
>I'd recommend against it.  It's going to slow the compiler down with marginal
>benefit.  I don't think you'll find much real code that will show any real
>benefit from adding another loop & cse pass.

  That seems to be the case.  I ran a version of cc1 and cc1plus over some
more sane code and saw _very_ little improvement.  It was meant as more of a
test to see if I could get the two loops to come out with the same assembly.

>Instead, we should spend time figuring out what's wrong with the existing
>scheme.  Long term we only want to be running one loop pass anyway (we will
>continue to have 2 cse passes though).
 
  I can try to look at this especially if someone could suggest a good
starting approach.  The rtl for the two loops should be very
similar after the first CSE, I suspect.  However, the loop with the
switch still has the construct but with no real body.  Compare this
with the loop with the if-else that has the entire internal body of the
loop removed.

  What I do not quite understand is if the body of a loop is removed
why not remove the loop itself as well?

---
Kent Vander Velden
kent@iastate.edu


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