diff options
author | Tanya Lattner <tonic@nondot.org> | 2004-11-28 23:36:15 +0000 |
---|---|---|
committer | Tanya Lattner <tonic@nondot.org> | 2004-11-28 23:36:15 +0000 |
commit | 28e5eabf65a7d5afddddbf5e90b0ed8c85140cd6 (patch) | |
tree | c2b31ebbc6217e9e441ab0f1cfbc46d980a79306 /lib/Target/SparcV9/ModuloScheduling/MSchedGraph.cpp | |
parent | b2e4cd645a3392501d41ad55c0d7753e75efe9ac (diff) |
Fixed bug where instructions in the kernel were not ordered right to preserve dependencies in a cycle.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18314 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/SparcV9/ModuloScheduling/MSchedGraph.cpp')
-rw-r--r-- | lib/Target/SparcV9/ModuloScheduling/MSchedGraph.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/Target/SparcV9/ModuloScheduling/MSchedGraph.cpp b/lib/Target/SparcV9/ModuloScheduling/MSchedGraph.cpp index a3b02f7821..5a415e7546 100644 --- a/lib/Target/SparcV9/ModuloScheduling/MSchedGraph.cpp +++ b/lib/Target/SparcV9/ModuloScheduling/MSchedGraph.cpp @@ -22,9 +22,9 @@ using namespace llvm; MSchedGraphNode::MSchedGraphNode(const MachineInstr* inst, - MSchedGraph *graph, + MSchedGraph *graph, unsigned idx, unsigned late, bool isBranch) - : Inst(inst), Parent(graph), latency(late), isBranchInstr(isBranch) { + : Inst(inst), Parent(graph), index(idx), latency(late), isBranchInstr(isBranch) { //Add to the graph graph->addNode(inst, this); @@ -113,7 +113,7 @@ void MSchedGraph::buildNodesAndEdges() { //Save PHI instructions to deal with later std::vector<const MachineInstr*> phiInstrs; - + unsigned index = 0; //Loop over instructions in MBB and add nodes and edges for (MachineBasicBlock::const_iterator MI = BB->begin(), e = BB->end(); MI != e; ++MI) { //Get each instruction of machine basic block, get the delay @@ -149,7 +149,7 @@ void MSchedGraph::buildNodesAndEdges() { isBranch = true; //Node is created and added to the graph automatically - MSchedGraphNode *node = new MSchedGraphNode(MI, this, delay, isBranch); + MSchedGraphNode *node = new MSchedGraphNode(MI, this, index, delay, isBranch); DEBUG(std::cerr << "Created Node: " << *node << "\n"); @@ -211,6 +211,7 @@ void MSchedGraph::buildNodesAndEdges() { } } } + ++index; } addMemEdges(memInstructions); addMachRegEdges(regNumtoNodeMap); |