scale.backend
Class BBIS

java.lang.Object
  extended by scale.backend.BBIS

public class BBIS
extends java.lang.Object

This class provides basic block instruction scheduling.

$Id: BBIS.java,v 1.15 2007-10-04 19:57:48 burrill Exp $

Copyright 2008 by the Scale Compiler Group,
Department of Computer Science
University of Massachusetts,
Amherst MA. 01003, USA
All Rights Reserved.

The basic organization for this instruction scheduler was inspired by Chapter 12 of "Engineering a Compiler" by Keith D. Cooper and Linda Torczon, Morgan Kaufman Publishers, ISBN: 1-55860-698-X.

The basic list scheduling algorithm is used. Both forward and backward list scheduling are tried for each basic block to obtain the best schedule. The scheduler picks the priority scheme used to select the next instruction based on metrics of the basic block.

Anit-dependencies are handled without renaming. When the scheduler is run prior to rgister allocation very little renaming is required. When run after register allocation, renaming cannot be used.

The schuler requires two pieces on information from each instruction in addition to the registers used or def-ed by the instruction.

  1. The length of time the instruction takes to execute in cycles.
  2. The type of instruction - that is the functional unit that will execute it.
The scheduler will ask the code generator for the number of functional units that are available for a given type.

To add a different instruction scheduler, derive it from this class and implement the schedule() method. Then modify the code generator to use the new instruction scheduler.


Field Summary
static boolean all
          True if all functions should be scheduled - false if just traced functions should be scheduled.
static boolean classTrace
          True if traces are to be performed.
protected  Generator gen
           
static int max
          Maximum block size to be scheduled.
static int min
          Minimum block size to be scheduled.
protected  RegisterSet registers
           
 
Constructor Summary
BBIS(Generator gen)
           
 
Method Summary
 Instruction schedule(Instruction insts, boolean trace)
          Schedule all the instructions in a function.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

classTrace

public static boolean classTrace
True if traces are to be performed.


all

public static boolean all
True if all functions should be scheduled - false if just traced functions should be scheduled.


min

public static int min
Minimum block size to be scheduled.


max

public static int max
Maximum block size to be scheduled.


gen

protected Generator gen

registers

protected RegisterSet registers
Constructor Detail

BBIS

public BBIS(Generator gen)
Method Detail

schedule

public Instruction schedule(Instruction insts,
                            boolean trace)
Schedule all the instructions in a function.

Parameters:
insts - is the list of instructions
Returns:
the list of instructions in scheduled order