This is the mail archive of the gcc-patches@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]
Other format: [Raw text]

Re: [patch] Disable old loop optimizer


On Wed, 2005-04-13 at 12:32 +0200, Steven Bosscher wrote:

> 
> > 2) loop reversal
> [snip]
> >    the major 
> >    problem is to decide when it is really useful.
> 
> Are there any papers that discuss this?
If there are, I'd expect them to be bloody old.

The code in question was designed to allow us to take advantage of two
architecture features that allowed such loops to run faster:

  1. On vaxes, m68ks, HPPA and a few other architectures, there was a
     special decrement + compare to zero and branch instruction.  dbCC
     insns were usually faster than two separate instructions and in
     some cases *much* faster (m68010 branching backwards 2 instructions
     for example).

  2. Even if the architecture didn't have a decrement-and-branch
     instruction it was often slightly faster to test a value against
     zero rather than an arbitrary constant or register.


The problem (of course) is that these transformations can be done
quite a bit easier in the tree world (just look at the contortions
we do in loop.c for this stuff, ick), but the costing models assume
we'll know something about the backend.  

jeff


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