coins.backend.sched
Class DependGraph

java.lang.Object
  extended bycoins.backend.sched.DependGraph

public class DependGraph
extends java.lang.Object

A DependGraph is made from a basic block. It has two lists of DependNodes, schedulabale and unSchedulable.


Field Summary
(package private)  Function func
           
(package private) static int LAST_TIME
           
(package private)  DependNode lastBranch
           
(package private)  Root root
           
(package private)  BiList schedulable
           
(package private)  BiList unSchedulable
           
 
Constructor Summary
DependGraph(Function f)
           
 
Method Summary
 void add(DependNode dn)
          Add a DependNode dn to the schedulable list if it is independent, otherwise add to the unSchedulable list.
(package private)  void findSchedulable(DependNode dn)
          Find newly schedulable DependNode after updating the dependent information by scheduled dn.
(package private)  boolean foundDepend(DependNode dn)
          If the schedulable list or the unShedulable list contains a DependNode on which the DependNode dn depends, return true.
 void hasBranch(DependNode dn)
          Set dn to lastBranch.
 void newSegment()
           
(package private)  DependNode schedule()
          Select next DependNode from schedulable list.
(package private)  BiList scheduleInst()
          Schedule all instructions in this DependGraph.
(package private)  BiList scheduleLir()
          Schedule all LirNodes in this DependGraph.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

LAST_TIME

static final int LAST_TIME
See Also:
Constant Field Values

func

Function func

root

Root root

schedulable

BiList schedulable

unSchedulable

BiList unSchedulable

lastBranch

DependNode lastBranch
Constructor Detail

DependGraph

public DependGraph(Function f)
Method Detail

newSegment

public void newSegment()

add

public void add(DependNode dn)
Add a DependNode dn to the schedulable list if it is independent, otherwise add to the unSchedulable list.

Parameters:
dn -

foundDepend

boolean foundDepend(DependNode dn)
If the schedulable list or the unShedulable list contains a DependNode on which the DependNode dn depends, return true. Otherwose, return false. Dependent information is set during the search.

Parameters:
dn -

hasBranch

public void hasBranch(DependNode dn)
Set dn to lastBranch. This block has dn as the last branch instruction.

Parameters:
dn -

scheduleInst

BiList scheduleInst()
Schedule all instructions in this DependGraph. If a Call instruction is followed by a nop, the nop is replaced by the previous instruction. If a instruction has no dependant and the last branch instruction is followed by a nop, the nop is replaced by the instruction.

Returns:
scheduled asm list

scheduleLir

BiList scheduleLir()
Schedule all LirNodes in this DependGraph.

Returns:
scheduled LirNode list

schedule

DependNode schedule()
Select next DependNode from schedulable list.

Returns:
scheduled DependNode

findSchedulable

void findSchedulable(DependNode dn)
Find newly schedulable DependNode after updating the dependent information by scheduled dn.

Parameters:
dn -

toString

public java.lang.String toString()