The SUIF Programs and Passes Guide

The SUIF compiler infrastructure is designed to be modular so as to facilitate research in compilers. Users can easily create new passes or combine different passes together to build a complete compiler. The current SUIF system consists of a number of predefined standalone programs for generating and manipulating the SUIF representations. In particular, the user can use the suifdriver, one of the standalone programs, to run one or more compiler passes that translate a SUIF representation to another. The system currently includes a set of passes that are mostly simple transforms to dismantle high-level constructs and utilities for checking and cleaning up the representation.

Table of contents

Setup and Hints

Before executing any of these programs , the user MUST set up some environment variables. This can be done in the csh or tcsh shells with:
source $(NCIHOME)/suif_setup.csh
In sh or bash shells use:
You can usually find out what a standalone program in $NCIHOME/bin does by simply invoking the program without any arguments. It will usually print out a usage description if it expects any arguments. Example:
> suif2c
Usage: suif2c [-o outputfile] [-keep] [-v] [-ftn] [-arch ARCH] file.suif
Create a C file from a suif file with SUIF and BASIC nodes.
The default output filename will be file.out.c
The architecture will be read from the Linux variable
or the command line -arch flag, or the output of 'uname'
You can usually find out what a shared library in $NCIHOME/solib does by simply importing it into the suifdriver and invoking list_modules. Example:
> suifdriver -e "import usefulpasses; list_modules"

Module: exec:
Description: Usage:
exec ...
executes a shell command in

Module: validate_suif:
Description: validates the FileSetBlock

Module: gc_symbol_table:
Description: Remove unreferenced Types and Symbols from external symbol table.

Module: count_suif_object:
Description: Count number of suif IR objects

Standalone Programs

These are a collection of self-contained programs found in the "bin" subdirectory.

Front Ends

Back Ends

SUIF Pass Drivers and Tools

Format Translators

Tools for developing passes

Instances of standalone compiler passes

Contributed software

Programs Invoked Internally

Base SUIF Libraries

These are libraries found in the "solib" subdirectory. These libraries can be imported into the suifdriver. A module defined in a library can define a set of IR nodes, or it can define a set of passes. In the suifdriver is a SUIF environment (SuifEnv) to which the user can import new libraries and load new SUIF files. The commands, when invoked, typically apply to the current IR file that is loaded into the Suif environment.

Modules with Intermediate Representation Nodes

Modules with Compiler Passes