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


> OK, here goes.

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).
  I think my scheme has O(1) in general (there could be pathologic cases
  when the hash chains gets too long, but that is unlikely, and if it
  ever gets worrysome, it could be cured with variable has table size or
  expandable hash tables).
- 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.
- 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?
- Your code can generate PRE_MODIFY / POST_MODIFY, something which mine
  can't.
- 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.

So right now, our patches really do different things, with only a small
overlap.
Of course this could be changed.


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