University of Arizona, Department of Computer Science

CSc 553 Fall 2018: Project

Overview

In the course of the semester, we will implement an optimizing compiler for a subset of C called C--. The project will consist of a series of programming assignments, each of which depends on all of the previous assignments. For this reason, it is crucial that you write your code in a way that makes it easy to debug and extend.

I will attempt to provide, to the best of my ability, a precise specification for each programming assignment. Programs are expected to meet these specifications exactly. Questions and clarifications should be settled beforehand. Programs that do not meet the stated specifications will be penalized heavily.

Assignments

  1. Syntax Tree Traversal
    Function: Write code to traverse the syntax tree of each function and print it out. Get familiar with the syntax tree and symbol table code.
    Given: front end for a C-- compiler;
    Output: printout of syntax tree.
    Specification
    Start date: Mon Aug 27
    Due date: Mon Sept 3
    Note: This does not have to be turned in and will not be graded for credit.
  2. Code Generation
    Function: Generate assembly code.
    Input: annotated syntax tree + symbol table;
    Output: instruction sequence/assembly code.
    Specification
    Start date: Mon Sept 10
    Due date: Mon Oct 1
  3. Machine-Independent Optimization
    Function: Dataflow analysis; dead code elimination.
    Input: instruction sequence;
    Output: instruction sequence.
    Specification
    Start date: Mon Oct 8
    Due date: Mon Oct 22 Tue Oct 23
  4. Register Allocation
    Function: register allocation.
    Input: instruction sequence;
    Output: instruction sequence.
    Specification
    Start date: Mon Oct 29
    Due date: Mon Nov 12
  5. Either of the following:

    1. More complex optimization

      Function: Global common subexpression elimination.
      Input: instruction sequence;
      Output: instruction sequence.
      Specification

    OR

    1. Term paper based on the research literature.
      Specification

    Start date (for both the Global CSE program and the Term paper): Mon Nov 19
    Due date (for both the Global CSE program and the Term paper): Mon Dec 3