+//===-- InterferenceGraph.h - Interference graph for register coloring -*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file was developed by the LLVM research group and is distributed under
+// the University of Illinois Open Source License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
/* Title: InterferenceGraph.h -*- C++ -*-
Author: Ruchira Sasanka
Date: July 20, 01
setCurDegreeOfIGNodes() before pushing IGNodes on to stack for coloring.
*/
+#ifndef INTERFERENCEGRAPH_H
+#define INTERFERENCEGRAPH_H
-#ifndef INTERFERENCE_GRAPH_H
-#define INTERFERENCE_GRAPH_H
-
-
-#include "llvm/CodeGen/IGNode.h"
-
-typedef std::vector <IGNode *> IGNodeListType;
-
+#include <vector>
+class LiveRange;
+class RegClass;
+class IGNode;
-class InterferenceGraph
-{
+class InterferenceGraph {
char **IG; // a poiner to the interference graph
unsigned int Size; // size of a side of the IG
RegClass *const RegCl; // RegCl contains this IG
- IGNodeListType IGNodeList; // a list of all IGNodes in a reg class
+ std::vector<IGNode *> IGNodeList; // a list of all IGNodes in a reg class
- // for asserting this IG node is infact in the IGNodeList of this class
- inline void assertIGNode(const IGNode *const Node) const {
- assert( IGNodeList[ Node->getIndex() ] == Node );
- }
-
-
-
public:
-
// the matrix is not yet created by the constructor. Call createGraph()
// to create it after adding all IGNodes to the IGNodeList
-
- InterferenceGraph(RegClass *const RC);
+ InterferenceGraph(RegClass *RC);
~InterferenceGraph();
void createGraph();
- void addLRToIG(LiveRange *const LR);
+ void addLRToIG(LiveRange *LR);
- void setInterference(const LiveRange *const LR1,
- const LiveRange *const LR2 );
+ void setInterference(const LiveRange *LR1,
+ const LiveRange *LR2);
- unsigned getInterference(const LiveRange *const LR1,
- const LiveRange *const LR2 ) const ;
+ unsigned getInterference(const LiveRange *LR1,
+ const LiveRange *LR2) const ;
- void mergeIGNodesOfLRs(const LiveRange *const LR1, LiveRange *const LR2);
+ void mergeIGNodesOfLRs(const LiveRange *LR1, LiveRange *LR2);
- inline IGNodeListType &getIGNodeList() { return IGNodeList; }
+ std::vector<IGNode *> &getIGNodeList() { return IGNodeList; }
+ const std::vector<IGNode *> &getIGNodeList() const { return IGNodeList; }
void setCurDegreeOfIGNodes();