aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/ModuloScheduling/ModuloSchedGraph.h
diff options
context:
space:
mode:
authorMisha Brukman <brukman+llvm@gmail.com>2003-04-10 19:19:23 +0000
committerMisha Brukman <brukman+llvm@gmail.com>2003-04-10 19:19:23 +0000
commit2c821cc06e0a94704ce4eef72d3ebfcb561ba1ff (patch)
tree9beecc706fb2a94a1c61ed2362efdfcf59dcb770 /lib/CodeGen/ModuloScheduling/ModuloSchedGraph.h
parent8baa01c1d79d8cff13634a48339cf551e30eaf14 (diff)
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
Diffstat (limited to 'lib/CodeGen/ModuloScheduling/ModuloSchedGraph.h')
-rw-r--r--lib/CodeGen/ModuloScheduling/ModuloSchedGraph.h57
1 files changed, 28 insertions, 29 deletions
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 <iostream>
-//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<ModuloSchedGraphNode*> 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<pair<int,int>>&, int);
+void addResourceUsage(std::vector<std::pair<int,int> > &, int);
//debug functions:
//dump circuits
@@ -181,7 +174,7 @@ void addResourceUsage(std::vector<pair<int,int>>&, int);
//dump the input set of nodes
void dumpSet(std::vector<ModuloSchedGraphNode*> set);
//dump the input resource usage table
- void dumpResourceUsage(std::vector<pair<int,int>> &);
+ void dumpResourceUsage(std::vector<std::pair<int,int> > &);
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<const Instruction*, ModuloSchedGraphNode*>
+ // Unorder iterators
+ // return values are pair<const Instruction*, ModuloSchedGraphNode*>
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