CSE4251/CSE5251: Assignment 7

Due: Friday, 14 April 2006

Incorporate canonicalization (Chapter 8), add the "maximal munch" algorithm "Chapter 9: Instruction Section," page 216. Your makefile should create a jar file called select.jar which is phase 8 of the compiler.

All, or most, of the code for this phase could be in a one file. It could would be placed in the sparc package as it is specific to the machine architecture.

Canon and Assem package

Use these two packages as-is without modifying any of the classes. Nothing needs to be added to these packages. The source and class files for these packages should be in the support.jar file (among other things).

The (revised) canon package has a method in the class Main that encapulates all the work of chapter 8.

   public static StmList transform (Stm s) {
      final StmList stms = Canon.linearize (s);
      final BasicBlocks bb = new BasicBlocks(stms);
      final StmList traces = (new TraceSchedule(bb)).stms;
      return traces;
   }

Output

The verbose output (in file -08.txt) should show the IR trees after linearization. There is no need for verbose output showing the accomplishments of phase 9, because now the output file .s should be written. Though the output file is not real SPARC assembly code (yet), a printable form of the instructions can be printed out. This is necesary to debug instruction selection.

Turning it in

Collect all the source files and the makefile into a single jar file phase06.jar. Turn in the jar file for the compiler using the submission server. Use the following parameters

-Dclass=cse4251 -Dproject=asgn7

Ryan Stansifer <ryan@cs.fit.edu>
Last modified: Thu Apr 10 17:18:08 EDT 2003