Related articles |
---|
Compiler Optimizing assembler wstryd@ilink.nis.za (Werner Strydom) (1996-11-03) |
Re: Compiler Optimizing assembler grout@sp55.csrd.uiuc.edu (1996-11-03) |
Re: Compiler Optimizing assembler pardo@cs.washington.edu (1996-11-03) |
Re: Compiler Optimizing assembler dlmoore@ix.netcom.com (David L Moore) (1996-11-03) |
Re: Compiler Optimizing assembler jacob@jacob.remcomp.fr (1996-11-05) |
Re: Compiler Optimizing assembler Martin.Ward@durham.ac.uk (1996-11-05) |
Re: Compiler Optimizing assembler sri@gomez.sc.intel.com (K. Sridharan) (1996-11-07) |
Re: Compiler Optimizing assembler walter@bytecraft.com (Walter Banks) (1996-11-07) |
Re: Compiler Optimizing assembler shankar@chromatic.com (1996-11-10) |
From: | jacob@jacob.remcomp.fr (Jacob Navia) |
Newsgroups: | comp.compilers |
Date: | 5 Nov 1996 23:33:20 -0500 |
Organization: | Compilers Central |
References: | 96-11-029 |
Keywords: | tools, assembler |
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'
available...
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
holidays...
If interested, answer by e-mail.
--
Jacob Navia Logiciels/Informatique
41 rue Maurice Ravel Tel (1) 48.23.51.44
93430 Villetaneuse Fax (1) 48.23.95.39
France
--
Return to the
comp.compilers page.
Search the
comp.compilers archives again.