|Compiler Optimizing assembler firstname.lastname@example.org (Werner Strydom) (1996-11-03)|
|Re: Compiler Optimizing assembler email@example.com (1996-11-03)|
|Re: Compiler Optimizing assembler firstname.lastname@example.org (1996-11-03)|
|Re: Compiler Optimizing assembler email@example.com (David L Moore) (1996-11-03)|
|Re: Compiler Optimizing assembler firstname.lastname@example.org (1996-11-05)|
|Re: Compiler Optimizing assembler Martin.Ward@durham.ac.uk (1996-11-05)|
|Re: Compiler Optimizing assembler email@example.com (K. Sridharan) (1996-11-07)|
|Re: Compiler Optimizing assembler firstname.lastname@example.org (Walter Banks) (1996-11-07)|
|Re: Compiler Optimizing assembler email@example.com (1996-11-10)|
|From:||firstname.lastname@example.org (Jacob Navia)|
|Date:||5 Nov 1996 23:33:20 -0500|
Well, I have written an optimizer like the one you want. In general,
it tries to optimize the output of the version of 'lcc' (see
princeton.edu) that I was working with.
The algorithm is very straightforward:
Take a sequence of assembler instructions between two labels. Call it
a 'basic block', even if theorists will not accept it since it CAN
contain jumps out of the block, but not jumps into the middle of the
block. Make a table of the registers your machine has. Buy the
assembler programming user's guide (it cost me more than 100 US$ from
Intel Corp, but it was every cent worth...) Put the initial state at
the beginning of the block as UNKNOWN. Try to follow the state of the
machine avoiding unnecessary register loads optimizing instructions,
etc etc. This is kind of fun, very addictive type of work, be
careful... I developed many interested heuristics, things to avoid,
pitfalls etc etc.
Be aware that any mistake of your part will make the compiler generate
bad code and tracing the bug in the program to the bug in your
optimizer can be HELL!!! Keep ALWAYS a 'last known good version'
I loved that program, even if it only improved performance by 30-50%
depending on the program. I haven't had the budget to go on with jump
optimization, but I scheduled that for this year's Christmas
If interested, answer by e-mail.
Jacob Navia Logiciels/Informatique
41 rue Maurice Ravel Tel (1) 220.127.116.11
93430 Villetaneuse Fax (1) 18.104.22.168
Return to the
Search the comp.compilers archives again.