On 4/4/2006 at 11:25 PM Brad Parker wrote:
more on topic, good compilers spend a lot of time
optimizing the 'tree'
of processed source long before generating any code. And most they days
spend a lot of time in the 'register transfer' stage working on the data
flow before writing any code. By the time they get around to emitting
code it's pretty straight forward and doesn't rely on nuances of
instructions. a gross oversimplification, but you get the point.
When I was part of a compiler-writing operation for FORTRAN for the
ETA-10, I was given the job of "backend implementation". Every other
programmer in a staff of 17 were frontend or optimization specialists. By
the time the code tree got to me, all I had to do was walk it, perform a
few peephole optimizations that were machine-specific and output the code
(and listing if desired). Even register usage had been pretty much
already determined by the time things got to me (I was free to use a small
number of temporaries).
It was pretty mindless work, actually. All of the fancy work had already
been done.
Cheers,
Chuck