Welcome to the wonderful world of EE663!


For submitting your code, bag.c is here...


The course policy document is here. You are responsible for reading, understanding, and complying with it.


Project 0

For the course projects, you will be adding optimizations to a compiler for a SWARC subset called SWARB. The first step is to get used to the SWARB compiler front-end. There are three files to look at:

swarb.c
This is the compiler front end, written as simple, ordinary, C code.
swarb.h
This is the compiler header file, which serves as the interface between all the parts, and which you will need to modify when you add your back-end code.
gendumc.c
This is a very dumb code generation back-end. It takes the vector trees and generates ordinary C code, with little attention to efficiency. It is provided as an example only.

Grab the above source files and compile them using:

cc swarb.c gendumc.c -o swarb

To run the code output by gendumc.c, you will need dumc.h

Familiarize yourself with the vector trees that interface between the fron end and gendumc.c -- this is where you start modifying with the first real project.


Project 1: I Go To Pieces (frag.c)

The first step is to make a file called frag.c that replaces the dumb C generation of gendumc.c with dumb tuple generation (i.e., builds the basic tuple fragment representation of the input). The handout is posted here as postscript. Although you can freely select the data structure(s) used for the tuples, because this is entirely internal to your code, a list of possible tuple opcodes is given as tup.h.


Project 2: You Gotta Know When To Fold (fold.c)

This phase simply has you computing values for expressions such that any constant-valued tuple expression yields a constant tuple with the resulting value. The handout is posted here as postscript.


Project 3: Deja Vu? Deja Vu?

Here, you will apply value numbering anaylsis, value propagation, and common subexpression elimination (CSE). The handout is posted here as postscript.


Project 4: You May Be A Redneck If...

... you can't do the math in this project. Here, you are simply applying a bunch of trivial algebraic identities. The handout is posted here as postscript.


Project 5: To Live And Die In B. B.

This phase uses a counting scheme to perform dead code elimination within basic blocks. A happy side-effect of the counting scheme is that the counts can be used later for register allocation. The handout is posted here as postscript.


Project 6: Register This!

The (slightly revised and corrected) handout is posted here as postscript and the support code, Sb.h is here. This phase is where you finally schedule, allocate registers, and generate MMX code.


Project 7: I'm Gonna Straighten This Out

The handout is posted here as postscript. Here you do global code straightening and CSE (with minor fixes as needed to your register allocator).


This year is the third time that EE663 is using, and requiring students to use, HTML.

If you are on ECN unix, you should be able to print a formatted hardcopy version of this (or any other) HTML document by selecting the Print option on Mosaic's File menu. You will probably want to set the Format for printed document to PostScript for a pretty hardcopy, or to HTML to see the actual formatting codes in the document.

An introduction to using HTML is http://www.ncsa.uiuc.edu/demoweb/html-primer.html

The undergraduate compiler notes (part of which you have been given as hardcopy in class) are available online:

Some other potentially useful places to visit:

This description was last updated January 27, 1999.