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: Autoincrement examples


Joern Rennecke writes:

 > My first impressions are:
 > 
 > - Your code will take huge amounts of compile time for large functions,
 >   since you process each register individually, and ref_find_ref_between
 >   can cause a nested traversal of parts of a basic block - making the
 >   total complexity something like O(3).

ref_find_ref_between is only very rarely called and is only used for
{pre,post}_modify addressing modes with a register increment.

Many of the register ref lists do not need to be computed.  However, I
found that this simplifies dead store elimination; this is essential
prior to autoinc processing if the loop unrolling has taken place.

Your code does not have to worry about this since flow has removed
dead stores.

 > - By processing each register separately, you miss register-register
 >   copies and three-address adds.  Optimizing code with such constructs
 >   was actually the main objective of my patch.  It actually reduces
 >   register pressure.

I have rarely found these cases to be important for autoinc address
generation.  However, reduction of register pressure is a good thing.

 > - You can handle hard registers.  Have you been prompted by some real
 >   word code to implement this, or was this an instance of doing it
 >   because you could, and with little extra effort?

The latter.  I find it sometimes mops up some of reloads spills...

 > - Your code can generate PRE_MODIFY / POST_MODIFY, something which mine
 >   can't.

Yes, this is important for DSP architectures; especially things like
matrix multiplication where you want a large stride.

 > - I'm not sure you if your code can rewrite
 >   (mem (plus (reg ..) (const_int ..))) to use a different offset?
 >   FWIW, mine can't, but it is feasible with some effort to
 > implement it.

With the information that I collect, these transformations would be
straightforward.  More importantly, I would like to reorder some of
the memory references to improve autoinc generation.

Does your code maintain the LOG_LINKS?  If so I would like to try
running the instruction combiner after the regmove pass.
Alternatively, could your code be easily modified to remove redundant
load instructions once an autoinc address was generated?

Michael.



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