Re: Is it just me or... (Anton Ertl)
25 Jan 1997 22:12:34 -0500

          From comp.compilers

Related articles
Is it just me or... (1997-01-22)
Re: Is it just me or... (1997-01-25)
Re: Is it just me or... (1997-01-25)
Re: Is it just me or... (1997-01-25)
Re: Is it just me or... (1997-01-26)
Re: Is it just me or... (1997-01-29)
Re: Is it just me or... (Tim Roberts) (1997-01-30)
Re: Is it just me or... (1997-02-07)
Re: Is it just me or... (1997-02-08)
[4 later articles]
| List of all articles for this month |

From: (Anton Ertl)
Newsgroups: comp.compilers
Date: 25 Jan 1997 22:12:34 -0500
Organization: Institut fuer Computersprachen, Technische Universitaet Wien
References: 97-01-180
Keywords: courses, practice, optimize (Jay Cole) writes:
> 1) Why isn't a compiler-type class taught in college that deals with
> the applications of compiler techniques in everyday, non-compiler
> design, programs. Maybe imbedded languages, or errant data parsing,
> etc, etc, etc. Although I've never written a 'formal' compiler, I've
> written a embedded selection language, and user interface language, a
> sorting language, etc, etc, etc. Most of these generated machine code
> directly into a code-aliased memory block and then jumped in and went
> to town. It seems to me that your standard CS student is more likely
> to run into this application of compiler theory more than the actual
> writing of 'full' compilers. After 10+ years in CS, I've only met a
> handful of 'real' compiler writers.

We do use some non-programming-language examples in our exams and in
some parts of the practical course. Most of the practical course uses
some small programming-language as example, mainly because we want to
go all the way down to assembly code generation, and you usually don't
generate assembly code for non-programs. Moreover, CS students are
more familiar with programming languages than with
application-specific languages.

Another reason might be that programming-langauge compilers are what
the students will have most contact with, so it might be helpful if
they understand how they work, what they can do and what they cannot
do (in particular, in optimization).

BTW, I think you are pretty unusual in generating native code within
your application. When I worked in the industry (not in a compiler
shop), I usually generated some compiler input, or some interpreted

If you give me some more information on your applications, I might use
them for inspiration for our course.

> 2) Am I one of the few people in the compiler world that prefers to
> generate and optimize code from a tree-type structure rather than
> tuples? I find optimization and manipulation much easier in the tree
> format. I just have a difficult time generating real good code from
> the tuple format. Is there a good book on tuple based code
> generation?

If you are talking about code selection, it looks like everybody is
using data flow graphs: trees for tree parsing, DAGs for

For optimization, the increasing popularity of SSA also appears to be
a move to a less sequential, more graph-based representation.

For register allocation, you need a sequential representation if you
want a fixed set of conflicts. Of course, allowing the register
allocator to make instruction scheduling decisions can improve
register allocation.

> 3) Are there any other books out there besides "The Design of an
> Optimizing Compiler" by Wulf? Even though this book is out of print
> and I had to get my copy through UMI, I have not been able to find
> another decent code generation book "theory-wise" than this one. His
> ideas on register allocation and jump optimization were a great
> stepping off point for me. Any other recommendations out there on
> this type of code optimization/generation or perhaps other techniques,
> methods?

There are many other books, but yes, most (all?) are somewhat weak on
the back end. You might try Wilhelm&Maurer, although the way they
present theory is a little heavy for my taste.

> 4) Any suggestions on optimal register allocations without using
> graphs? They are too slow. I have a pretty neat method right now,
> and because I write for the intel 386+ platform, so optimal register
> usage is more of a problem than normal. My register allocation scheme
> is based on walking the code tree (above) before code generation. If
> you're interested, let me know. It might take a while to write it up,
> but if there is interest, I'll try to publish it.

Optimal might always be too slow for you, although goodwin&wilken96
find that it takes only n^3 time in practice.

Your scheme may be interesting, or not. Describe it a little more
before going all the way to writing a paper.

    author = {David W. Goodwin and Kent D. Wilken},
    title = {Optimal and Near-optimal Global Register Allocation
                                    Using 0-1 Integer Programming},
    journal = spe,
    year = {1996},
    volume = {26},
    number = {8},
    month = august,
    pages = {929--965}

- anton
M. Anton Ertl

Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.