B. Traces
A trace is a linear path through the code. Trace sched-
uling and its variants are probably the most commonly im-
plemented forms of region scheduling. A Trace consists of
the operations from a list
of basic blocks
with the following properties.
1) Each basic block is a predecessor of the next on the list
(i.e., for each
, falls through or
branches to
).
2) For any
and , there is no path
except for those that go through (i.e., the code is
cycle free, except that the entire region can be part of
some encompassing loop).
The outlined area of Fig. 1 shows a typical trace. Note,
as the figure shows, this definition does not prohibit forward
branches within the region, or flow that leaves the region and
comes back into the region at a later point. Indeed, the lack of
these restrictions has been controversial in the research com-
munity because it makes Trace Scheduling compilers consid-
erably more complex than many researchers feel necessary.
Adding those restrictions, sometimes with code duplication
to mitigate their impact, is the principle behind several of the
later region scheduling regions discussed below.
Traces, and Trace Scheduling, were introduced by Fisher
[6], and were described more carefully by Fisher [18], and
especially Ellis [19].
C. Superblocks
Superblocks [20] are Traces, with the added restriction
that there may not be any branches into the region except to
the first block. Thus, a Superblock consists of the operations
from a list
of basic blocks with the same
properties as a trace.
1) Each basic block is a predecessor of the next on the list
(i.e., for each
, falls through or
branches to
).
2) For any
and , there is no path
except for those that go through (i.e., the code is
cycle free, except that the entire region can be part of
some encompassing loop).
And the additional property:
3) There may be no branches into a block in the region,
except to
. These outlawed branches are referred to
in the Superblock literature as side entrances.
The restriction against side entrances eliminates the very
difficult engineering surrounding compensation code in
Trace Scheduling. Superblock formation involves a region
enlarging technique called tail duplication, which allows
Superblocks to avoid ending the moment a side entrance is
encountered. Superblocks are built by first selecting a Trace.
Then, when a side entrance is encountered, a copy is made
of the rest of the trace. The side entrance then branches to
this copy, and the new code finally branches to the end of
the region, thus eliminating the side entrance. This process
continues as more blocks are added to the region and more
side entrances are encountered. Tail duplication, in essence,
adds the compensation code mandated by an entrance to
the region before the region is scheduled. As such, it trades
space for compiler complexity and must be used selectively.
The effect of this on the quality of the resultant schedules
is not well characterized in the research. It is worth noting
that the originators of Superblock scheduling also proposed
region-enlarging techniques that are meant to minimize
the extra code involved. These same techniques could be
profitably applied to Trace formation and other region
selection and enlarging methods.
All of the region scheduling techniques rely on region en-
largingtechniques to increase the amount of ILP the compiler
can exploit. But to a much greater extent, Superblock sched-
uling relies on tail duplication as an essential feature.
D. Treegions
A Treegion [21] is a region containing a tree of basic
blocks within the control flow of the program. That is, a Tree-
gion consists of the operations from a list
of basic blocks with the following properties.
1) Each basic block
, except for , has exactly one
predecessor. That predecessor,
is on the list, where
. This implies that any path through the Treegion
will yield a Superblock, that is, a Trace with no side
entrances.
2) For any
and , there is no path
except for those that go through (i.e., the code is
cycle free, except that the entire region can be part of
some encompassing loop).
As with superblocks, tail duplication and other enlarging
techniques are used to remove side entrance restrictions. Re-
gions in which there is only a single flow of control within the
region are sometimes called “linear regions.” In that sense,
Traces and Superblocks are linear regions, while Treegions
are “nonlinear regions.”
E. Other Region Shapes
There are several other regions that have been suggested,
and some that have been implemented. We do not cover them
in detail for various reasons: some because they have only
been suggested and leave many of the required implementa-
tion details to the reader; others (in particular, Hyperblocks)
because they are covered elsewhere, and others because they
are scheduling frameworks which have similar goals, but are
difficult to describe as scheduling algorithms.
One such method is Trace-2 [22]. Trace-2 is a nonlinear
region with a single entrance, like Treegions, but without the
restriction on side entrances. The implementation was so dif-
ficult that the author gave up in disgust, and knows of no one
who has implemented it. The description of Trace-2 leaves
many details to the implementer. It is worth noting that the
author concluded that a good implementation would require
a very thorough use of Program Dependence Graphs [23].
Hyperblocks [53] are single-entry, multiple-exit regions
with internal control flow. These are variants of Superblocks
with the technique of predication (which requires very ex-
1642 PROCEEDINGS OF THE IEEE, VOL. 89, NO. 11, NOVEMBER 2001