From 73e3e2e10f6a83f72651bb9e7d0a6ad107676ab9 Mon Sep 17 00:00:00 2001 From: Tanya Lattner Date: Sat, 8 May 2004 16:12:10 +0000 Subject: Updating my versions of ModuloScheduling in cvs. Still not complete. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13424 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/ModuloScheduling/ModuloScheduling.h | 51 ++++++++++++++++++++----- 1 file changed, 41 insertions(+), 10 deletions(-) (limited to 'lib/CodeGen/ModuloScheduling/ModuloScheduling.h') diff --git a/lib/CodeGen/ModuloScheduling/ModuloScheduling.h b/lib/CodeGen/ModuloScheduling/ModuloScheduling.h index 296d7054e2..b573b10486 100644 --- a/lib/CodeGen/ModuloScheduling/ModuloScheduling.h +++ b/lib/CodeGen/ModuloScheduling/ModuloScheduling.h @@ -41,22 +41,53 @@ namespace llvm { //Map that holds node to node attribute information std::map nodeToAttributesMap; + //Map to hold all reccurrences + std::set > > recurrenceList; + + //Set of edges to ignore, stored as src node and index into vector of successors + std::set > edgesToIgnore; + + //Vector containing the partial order + std::vector > partialOrder; + + //Vector containing the final node order + std::vector FinalNodeOrder; + + //Schedule table, key is the cycle number and the vector is resource, node pairs + std::map > > > schedule; + + //Current initiation interval + int II; + //Internal functions bool MachineBBisValid(const MachineBasicBlock *BI); int calculateResMII(const MachineBasicBlock *BI); + int calculateRecMII(MSchedGraph *graph, int MII); void calculateNodeAttributes(MSchedGraph *graph, int MII); - void calculateASAP(MSchedGraphNode *node, MSNodeAttributes &attributes, - int MII,std::set &visitedNodes); - void calculateALAP(MSchedGraphNode *node, MSNodeAttributes &attributes, int MII, - int maxASAP, std::set &visitedNodes); - void calculateHeight(MSchedGraphNode *node, - MSNodeAttributes &attributes, std::set &visitedNodes); - void calculateDepth(MSchedGraphNode *node, MSNodeAttributes &attributes, - std::set &visitedNodes); + + bool ignoreEdge(MSchedGraphNode *srcNode, MSchedGraphNode *destNode); + + + int calculateASAP(MSchedGraphNode *node, int MII,MSchedGraphNode *destNode); + int calculateALAP(MSchedGraphNode *node, int MII, int maxASAP, MSchedGraphNode *srcNode); + + int calculateHeight(MSchedGraphNode *node,MSchedGraphNode *srcNode); + int calculateDepth(MSchedGraphNode *node, MSchedGraphNode *destNode); int findMaxASAP(); - void ModuloSchedulingPass::orderNodes(); - void findAllReccurrences(MSchedGraphNode *node, std::vector &visitedNodes); + void orderNodes(); + void findAllReccurrences(MSchedGraphNode *node, + std::vector &visitedNodes, int II); + void addReccurrence(std::vector &recurrence, int II, MSchedGraphNode*, MSchedGraphNode*); + + void computePartialOrder(); + void computeSchedule(); + bool scheduleNode(MSchedGraphNode *node, + int start, int end); + + void predIntersect(std::vector &CurrentSet, std::vector &IntersectResult); + void succIntersect(std::vector &CurrentSet, std::vector &IntersectResult); + public: ModuloSchedulingPass(TargetMachine &targ) : target(targ) {} virtual bool runOnFunction(Function &F); -- cgit v1.2.3-18-g5258