Go to the first, previous, next, last section, table of contents.
Each pass of the SUIF compiler represents an input program using a set
of complex data structures. Thus when a compiler pass needs to modify
the original program, it needs to manipulate these data structures.
A simple five line C program may need a few hundred complex structures to
represent the program in a SUIF compiler pass. Changing a single line
of the original C program while executing the compiler pass means
updating many of these data structures. These data structures are
highly interdependent and have to conform to a complex set of rules.
The goal of the builder is to abstract these complexities away from a
programmer writing a pass for the SUIF compiler. When a programmer
needs to change or add new code to the input program, the builder will
provide a simple and nice abstraction.
Advantages of using the builder are:
-
Very simple abstraction: Creating new code and changing existing code
is done using a C-like syntax. There is no need to understand the SUIF
internals and the rules governing the updates to the SUIF
structures.
-
A powerful abstraction: The builder has the same power as the C
language in transforming an algorithm to a code segment.
-
Simple and elegant code: Since many of the details are taken care
of by the builder, the code needed to do manipulations is very simple.
For example, an unrolling of a loop can be performed using six lines of
builder code instead of few pages of C++ code to explicitly manipulate
the SUIF structures.
-
Ease of debugging: The builder provides extensive syntactic and
semantic analysis of the code that is created.
-
Maintainable code: Future changes to SUIF may be transparent
to users of the builder since many of the rules governing the
SUIF system areabstracted away by the builder.
-
Single standard: When the builder is used, all the code
transformations across different passes of the compiler (at least at the
loop-level) will have a single code transformation standard. Since
there are thousands of different ways to do code transformations,
builder can establish some standard across passes by different
programmers.
Go to the first, previous, next, last section, table of contents.