Fixed bug where instructions in the kernel were not ordered right to preserve dependencies in a cycle.

llvm-svn: 18314
diff --git a/llvm/lib/Target/SparcV9/ModuloScheduling/MSchedGraph.h b/llvm/lib/Target/SparcV9/ModuloScheduling/MSchedGraph.h
index baa6373..36b7632 100644
--- a/llvm/lib/Target/SparcV9/ModuloScheduling/MSchedGraph.h
+++ b/llvm/lib/Target/SparcV9/ModuloScheduling/MSchedGraph.h
@@ -58,15 +58,17 @@
    
     const MachineInstr* Inst; //Machine Instruction
     MSchedGraph* Parent; //Graph this node belongs to
+    unsigned index; //Index in BB
     unsigned latency; //Latency of Instruction
     bool isBranchInstr; //Is this node the branch instr or not
+    
 
     std::vector<MSchedGraphNode*> Predecessors; //Predecessor Nodes
     std::vector<MSchedGraphEdge> Successors;
 
   public:
     MSchedGraphNode(const MachineInstr *inst, MSchedGraph *graph, 
-		    unsigned late=0, bool isBranch=false);
+		    unsigned index, unsigned late=0, bool isBranch=false);
 
     //Iterators
     typedef std::vector<MSchedGraphNode*>::iterator pred_iterator;
@@ -102,7 +104,7 @@
     bool hasSuccessors() { return (Successors.size() > 0); }
     unsigned getLatency() { return latency; }
     unsigned getLatency() const { return latency; }
-
+    unsigned getIndex() { return index; }
     MSchedGraphEdge getInEdge(MSchedGraphNode *pred);
     unsigned getInEdgeNum(MSchedGraphNode *pred);