From 2c821cc06e0a94704ce4eef72d3ebfcb561ba1ff Mon Sep 17 00:00:00 2001 From: Misha Brukman Date: Thu, 10 Apr 2003 19:19:23 +0000 Subject: Fixed compilation errors, command-line argument declarations, cleaned up code to look nicer and removed useless stuff. Also renamed a few variables, moved them into namespaces, converted outputting to a file into a print to std::cerr with a DEBUG() guard, as all passes should do anyway. No functional changes have been made. However, this code now compiles. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5769 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/ModuloScheduling/ModuloSchedGraph.h | 57 ++++++++++++------------- 1 file changed, 28 insertions(+), 29 deletions(-) (limited to 'lib/CodeGen/ModuloScheduling/ModuloSchedGraph.h') diff --git a/lib/CodeGen/ModuloScheduling/ModuloSchedGraph.h b/lib/CodeGen/ModuloScheduling/ModuloSchedGraph.h index 0947d32cb3..78718447e5 100644 --- a/lib/CodeGen/ModuloScheduling/ModuloSchedGraph.h +++ b/lib/CodeGen/ModuloScheduling/ModuloSchedGraph.h @@ -13,17 +13,10 @@ #include "llvm/Target/TargetInstrInfo.h" #include "Support/HashExtras.h" #include "Support/GraphTraits.h" +#include "Support/hash_map" #include "../InstrSched/SchedGraphCommon.h" #include -//for debug information selecton -enum ModuloSchedDebugLevel_t { - ModuloSched_NoDebugInfo, - ModuloSched_Disable, - ModuloSched_PrintSchedule, - ModuloSched_PrintScheduleProcess, -}; - //===----------------------------------------------------------------------===// // ModuloSchedGraphNode - Implement a data structure based on the // SchedGraphNodeCommon this class stores informtion needed later to order the @@ -160,20 +153,20 @@ private: typedef std::vector NodeVec; //the function to compute properties - void computeNodeASAP(const BasicBlock * bb); - void computeNodeALAP(const BasicBlock * bb); - void computeNodeMov(const BasicBlock * bb); - void computeNodeDepth(const BasicBlock * bb); - void computeNodeHeight(const BasicBlock * bb); + void computeNodeASAP(const BasicBlock *bb); + void computeNodeALAP(const BasicBlock *bb); + void computeNodeMov(const BasicBlock *bb); + void computeNodeDepth(const BasicBlock *bb); + void computeNodeHeight(const BasicBlock *bb); //the function to compute node property - void computeNodeProperty(const BasicBlock * bb); + void computeNodeProperty(const BasicBlock *bb); //the function to sort nodes void orderNodes(); //add the resource usage -void addResourceUsage(std::vector>&, int); +void addResourceUsage(std::vector > &, int); //debug functions: //dump circuits @@ -181,7 +174,7 @@ void addResourceUsage(std::vector>&, int); //dump the input set of nodes void dumpSet(std::vector set); //dump the input resource usage table - void dumpResourceUsage(std::vector> &); + void dumpResourceUsage(std::vector > &); public: //help functions @@ -195,16 +188,16 @@ public: NodeVec predSet(NodeVec set); //get the predessor set of the node - NodeVec predSet(ModuloSchedGraphNode * node, unsigned, unsigned); - NodeVec predSet(ModuloSchedGraphNode * node); + NodeVec predSet(ModuloSchedGraphNode *node, unsigned, unsigned); + NodeVec predSet(ModuloSchedGraphNode *node); //get the successor set of the set NodeVec succSet(NodeVec set, unsigned, unsigned); NodeVec succSet(NodeVec set); //get the succssor set of the node - NodeVec succSet(ModuloSchedGraphNode * node, unsigned, unsigned); - NodeVec succSet(ModuloSchedGraphNode * node); + NodeVec succSet(ModuloSchedGraphNode *node, unsigned, unsigned); + NodeVec succSet(ModuloSchedGraphNode *node); //return the uniton of the two vectors NodeVec vectorUnion(NodeVec set1, NodeVec set2); @@ -248,17 +241,22 @@ public: //return this basibBlock contains a loop bool isLoop(); - //return the node for the input instruction ModuloSchedGraphNode *getGraphNodeForInst(const Instruction * inst) const { const_iterator onePair = this->find(inst); return (onePair != this->end()) ? (*onePair).second : NULL; } - //Debugging support//dump the graph void dump() const; - //dump the basicBlock + + // Debugging support + //dump the graph + void dump() const; + + // dump the basicBlock void dump(const BasicBlock * bb); + //dump the basicBlock into 'os' stream void dump(const BasicBlock * bb, std::ostream & os); + //dump the node property void dumpNodeProperty() const; @@ -267,7 +265,8 @@ private: public: ModuloSchedGraph(const BasicBlock *bb, const TargetMachine &_target) - :SchedGraphCommon(bb), target(_target) { + :SchedGraphCommon(bb), target(_target) + { buildGraph(target); } @@ -276,8 +275,8 @@ public: delete I->second; } - //unorder iterators - //return values are pair + // Unorder iterators + // return values are pair using map_base::begin; using map_base::end; @@ -348,8 +347,8 @@ public: using baseVector::begin; using baseVector::end; -// Debugging support -void dump() const; + // Debugging support + void dump() const; private: void addGraph(ModuloSchedGraph *graph) { @@ -360,6 +359,6 @@ private: // Graph builder void buildGraphsForMethod(const Function *F, const TargetMachine &target); -} +}; #endif -- cgit v1.2.3-18-g5258