aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/ModuloScheduling/ModuloScheduling.h
diff options
context:
space:
mode:
authorTanya Lattner <tonic@nondot.org>2004-05-08 16:12:10 +0000
committerTanya Lattner <tonic@nondot.org>2004-05-08 16:12:10 +0000
commita6820d6704cb817717ccfde3168cafd2af960bb5 (patch)
tree5bb626634a53160ea7134ea9c7a4c3452b8de092 /llvm/lib/CodeGen/ModuloScheduling/ModuloScheduling.h
parent1096ba9422bbf6bb9845af509a0547ef5d2c1113 (diff)
downloadllvm-a6820d6704cb817717ccfde3168cafd2af960bb5.zip
llvm-a6820d6704cb817717ccfde3168cafd2af960bb5.tar.gz
llvm-a6820d6704cb817717ccfde3168cafd2af960bb5.tar.bz2
Updating my versions of ModuloScheduling in cvs. Still not complete.
llvm-svn: 13424
Diffstat (limited to 'llvm/lib/CodeGen/ModuloScheduling/ModuloScheduling.h')
-rw-r--r--llvm/lib/CodeGen/ModuloScheduling/ModuloScheduling.h51
1 files changed, 41 insertions, 10 deletions
diff --git a/llvm/lib/CodeGen/ModuloScheduling/ModuloScheduling.h b/llvm/lib/CodeGen/ModuloScheduling/ModuloScheduling.h
index 296d705..b573b10 100644
--- a/llvm/lib/CodeGen/ModuloScheduling/ModuloScheduling.h
+++ b/llvm/lib/CodeGen/ModuloScheduling/ModuloScheduling.h
@@ -41,22 +41,53 @@ namespace llvm {
//Map that holds node to node attribute information
std::map<MSchedGraphNode*, MSNodeAttributes> nodeToAttributesMap;
+ //Map to hold all reccurrences
+ std::set<std::pair<int, std::vector<MSchedGraphNode*> > > recurrenceList;
+
+ //Set of edges to ignore, stored as src node and index into vector of successors
+ std::set<std::pair<MSchedGraphNode*, unsigned> > edgesToIgnore;
+
+ //Vector containing the partial order
+ std::vector<std::vector<MSchedGraphNode*> > partialOrder;
+
+ //Vector containing the final node order
+ std::vector<MSchedGraphNode*> FinalNodeOrder;
+
+ //Schedule table, key is the cycle number and the vector is resource, node pairs
+ std::map<unsigned, std::vector<std::pair<unsigned, std::vector<MSchedGraphNode*> > > > 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<MSchedGraphNode*> &visitedNodes);
- void calculateALAP(MSchedGraphNode *node, MSNodeAttributes &attributes, int MII,
- int maxASAP, std::set<MSchedGraphNode*> &visitedNodes);
- void calculateHeight(MSchedGraphNode *node,
- MSNodeAttributes &attributes, std::set<MSchedGraphNode*> &visitedNodes);
- void calculateDepth(MSchedGraphNode *node, MSNodeAttributes &attributes,
- std::set<MSchedGraphNode*> &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<MSchedGraphNode*> &visitedNodes);
+ void orderNodes();
+ void findAllReccurrences(MSchedGraphNode *node,
+ std::vector<MSchedGraphNode*> &visitedNodes, int II);
+ void addReccurrence(std::vector<MSchedGraphNode*> &recurrence, int II, MSchedGraphNode*, MSchedGraphNode*);
+
+ void computePartialOrder();
+ void computeSchedule();
+ bool scheduleNode(MSchedGraphNode *node,
+ int start, int end);
+
+ void predIntersect(std::vector<MSchedGraphNode*> &CurrentSet, std::vector<MSchedGraphNode*> &IntersectResult);
+ void succIntersect(std::vector<MSchedGraphNode*> &CurrentSet, std::vector<MSchedGraphNode*> &IntersectResult);
+
public:
ModuloSchedulingPass(TargetMachine &targ) : target(targ) {}
virtual bool runOnFunction(Function &F);