This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Autoincrement examples
- To: m dot hayes at elec dot canterbury dot ac dot nz (Michael Hayes)
- Subject: Re: Autoincrement examples
- From: Joern Rennecke <amylaar at cygnus dot co dot uk>
- Date: Fri, 19 Nov 1999 02:01:34 +0000 (GMT)
- Cc: m dot hayes at elec dot canterbury dot ac dot nz, law at cygnus dot com, gcc at gcc dot gnu dot org, amylaar at cygnus dot com
> 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.