|New compiler - Orange C email@example.com (bluefish17) (2010-04-10)|
|Date:||Sat, 10 Apr 2010 21:54:55 -0700 (PDT)|
|Posted-Date:||12 Apr 2010 01:31:05 EDT|
I'Ve Been Working On A Retargetable (Optimizing) C99 Compiler/
Toolchain For A While... Thought I Would Bring It Up Here Because I
Recently Finished With Basic Optimizations And Thought Maybe Someone
Would Be Interested In Some Of The Algorithms...
Mostly it's basic run of the mill stuff you would find in any
optimizing compiler (bear in mind I haven't progressed beyond single
procedure optimizations)... a lot of it was originally inspired by
Robert Morgan 'Building an Optimizing Compiler' but I did do a couple
of things differently. For example I took the alternate tack with
aliasing info; instead of propagating the aliasing through from the
front end I calculate it from the intermediate code. There is a nice
research paper on this and it works pretty well. Also, I implemented
what I think is a fairly interesting form of lazy code motion from the
research. The third thing I did was take the two major papers on
iterated register coalescing (which is a register allocation
algorithm) and integrate them with a third on generalized register
allocation... to come up with what I think will be a robust way of
handling register allocations for different types of architectures
whenever I get to the point of concentrating more fully on retargeting
the compiler. I had to go a bit beyond Morgan also for an efficient
DOM tree generation algorithm and I wanted at least minimal loop
invariant handling, which I derived from a comment on how Scribble
All this is referenced in the code against the research papers that
led to the algorithms...
To be fair the compiler is retargetable as is, I'm just not satisfied
with the amount of effort it takes to retarget it. Mostly now you
have to hand write a lot of code whereas I'm heading for architecture
description files... anyway if it matters my retargeting design is a
little more friendly to byte and word-oriented architectures than say
GCC or LCC... and it should also handle quad word processors as-is,
but my work in progress is heading toward even better retargetability.
if anyone is interested in taking a peak, the sources for the compiler
along with binaries for a tool chain using it that runs on and targets
WIN32 and MSDOS.
Return to the
Search the comp.compilers archives again.