Related articles |
---|
SLO too slow? icsu8209@nero.cs.montana.edu (1990-09-03) |
Re: SLO too slow? bright@Data-IO.COM (1990-09-06) |
Newsgroups: | comp.compilers |
From: | bright@Data-IO.COM (Walter Bright) |
Keywords: | optimize |
Organization: | Data I/O Corporation; Redmond, WA |
References: | <9009031649.AA02942@nero.cs.montana.edu> |
Date: | 6 Sep 90 01:46:11 GMT |
In article <9009031649.AA02942@nero.cs.montana.edu> icsu8209@nero.cs.montana.edu (Glassy) writes:
<The idea, of course, is a portable optimiser. Code improvements like CSE,
<code motion, and strength reduction should (I wonder) be possible to perform
<at the source level, instead of only at the IR level (which is what seems
<most common).
The approach I'd use (which I've seen done successfully) is to optimize the
IR. Translate the IR back into C for the output file. The translation is
usually pretty simple.
The reason the project I knew about did this was in an attempt to write a
debugger for optimized code. It also made for great ease in debugging the
optimizer!
My optimizer (Zortech's) when compiled in debug mode, can dump its output
in C. This makes it much easier to debug...
<(I know real cases exist where declaring something as 'register' yields 300%
<speedup...
The optimizer determines register candidates, and sorts them in order of
desirability of actually stuffing them into registers. The code generator
does the stuffing. The C output would just see the declarations with
'register' in front of them, sorted from most desirable to least desirable.
You can even do coloring this way, simply name the variables that color
into the same register with the same name!
--
Return to the
comp.compilers page.
Search the
comp.compilers archives again.