00001 #ifndef _SCHEDULING_UTILITIES_H_ 00002 #define _SCHEDULING_UTILITIES_H_ 00003 00004 #include <lego.H> 00005 #include "TinkerKnobs.H" 00006 #include "legoUtil.H" 00007 #include "machine.h" 00008 #include "dag.H" 00009 #include "dag_node_ordering.H" 00010 #include "chains.H" 00011 #include "opList.H" 00012 #include "rdef.H" 00013 #include "legoAn.H" 00014 00015 00016 // IsDominatorParallel: checks to see if copies of op have been scheduled 00017 // in a dominator region. Returns a 0 if no, otherwise returns the 00018 // earliest schedule time of any copy that is scheduled. 00019 int IsDominatorParallel(legoOp *op, int readytime, legoTreegion* treegion); 00020 00021 // GetFlowDepOprd: returns a ptr to the legoOprd that forms a flow dep 00022 // between the Producer and Consumer operands. If Producer writes 00023 // multiple values, the _first_ legoOprd is returned. If no flow-dep 00024 // is found, NULL is returned. 00025 legoOprd *GetFlowDepOprd( legoOp *Producer, legoOp *Consumer ); 00026 00027 // ResetS_Times: Resets s_times for all operations in a procedure to -1 so 00028 // that another pass of scheduling may follow 00029 void ResetSchedTimes( legoProc *proc ); 00030 00031 // BuildDagForRegion: builds a dag for the region 00032 void BuildDagForRegion( legoRegion *Region, machine *Machine, knobs *Knobs ); 00033 00034 // BuildDagsForProc: build dags for the regions contained within ProcPtr 00035 void BuildDagsForProc( legoProc *ProcPtr, machine *Machine, knobs *Knobs ); 00036 00037 // PrintDagsForProc: print dags for the regions contained within ProcPtr 00038 void PrintDagsForProc( legoProc *ProcPtr ); 00039 00040 //HZ: 08/25/00 00041 // PrintDagsForProc: print dags for the regions contained within ProcPtr 00042 void PrintDagsForProc( legoProc *ProcPtr, ofstream & os1 ); 00043 00044 00045 // SetNodeHeightsAndDepthsForRegion: as the name says, sets these fields for 00046 // use by later scheduling passes 00047 void SetNodeHeightsAndDepthsForRegion( legoRegion *Region ); 00048 00049 // SetNodeHeightsAndDepthsForProc: as the name says, sets these fields for 00050 // use by later scheduling passes 00051 void SetNodeHeightsAndDepthsForProc( legoProc *ProcPtr ); 00052 00053 // SetValuesForRegion: as the name says, set Value field for each Op for 00054 // use by later scheduling passes 00055 void SetValuesForRegion( legoRegion *Region, knobs *Knobs ); 00056 00057 // SetValuesForProc: as the name says, set the Value field for each Op for 00058 // use by later scheduling passes 00059 void SetValuesForProc( legoProc *ProcPtr, knobs *Knobs ); 00060 00061 // MakeValueListForRegion: do a Value-based sorting on nodes 00062 // within the Region 00063 void MakeValueListForRegion( legoRegion *Region ); 00064 00065 // MakeValueListForProc: do a Value-based sorting on nodes 00066 // within the Proc 00067 void MakeValueListForProc( legoProc *ProcPtr ); 00068 00069 // RemoveExtraAttributes: deletes non-standard attributes from Ops in Proc 00070 void RemoveExtraAttributes( legoProc *Proc ); 00071 00072 00073 // One of the following two routines should be used after scheduling. If 00074 // they are not, the 'driver' program will have a memory leak and behavior 00075 // ir not gauranteed. 00076 00077 // DeleteRegionDag: Delete the dag for the block 00078 void DeleteRegionDag( legoRegion *Region ); 00079 00080 // DeleteDagsInProc: Delete all dags in the proc 00081 void DeleteDagsInProc( legoProc *ProcPtr ); 00082 00083 #endif
1.3.2