summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--llvm/include/llvm/CodeGen/PBQP/Graph.h8
-rw-r--r--llvm/include/llvm/CodeGen/PBQP/RegAllocSolver.h1
2 files changed, 9 insertions, 0 deletions
diff --git a/llvm/include/llvm/CodeGen/PBQP/Graph.h b/llvm/include/llvm/CodeGen/PBQP/Graph.h
index a55f0ea96c0..f4294e713e6 100644
--- a/llvm/include/llvm/CodeGen/PBQP/Graph.h
+++ b/llvm/include/llvm/CodeGen/PBQP/Graph.h
@@ -56,6 +56,7 @@ namespace PBQP {
typedef typename CostAllocator::MatrixPtr MatrixPtr;
typedef typename SolverT::NodeMetadata NodeMetadata;
typedef typename SolverT::EdgeMetadata EdgeMetadata;
+ typedef typename SolverT::GraphMetadata GraphMetadata;
private:
@@ -172,6 +173,7 @@ namespace PBQP {
// ----- MEMBERS -----
+ GraphMetadata Metadata;
CostAllocator CostAlloc;
SolverT *Solver;
@@ -331,6 +333,12 @@ namespace PBQP {
/// \brief Construct an empty PBQP graph.
Graph() : Solver(nullptr) { }
+ /// \brief Get a reference to the graph metadata.
+ GraphMetadata& getMetadata() { return Metadata; }
+
+ /// \brief Get a const-reference to the graph metadata.
+ const GraphMetadata& getMetadata() const { return Metadata; }
+
/// \brief Lock this graph to the given solver instance in preparation
/// for running the solver. This method will call solver.handleAddNode for
/// each node in the graph, and handleAddEdge for each edge, to give the
diff --git a/llvm/include/llvm/CodeGen/PBQP/RegAllocSolver.h b/llvm/include/llvm/CodeGen/PBQP/RegAllocSolver.h
index 977c34843bb..4b6bf0e6c00 100644
--- a/llvm/include/llvm/CodeGen/PBQP/RegAllocSolver.h
+++ b/llvm/include/llvm/CodeGen/PBQP/RegAllocSolver.h
@@ -144,6 +144,7 @@ namespace PBQP {
typedef RegAlloc::NodeMetadata NodeMetadata;
struct EdgeMetadata { };
+ struct GraphMetadata { };
typedef PBQP::Graph<RegAllocSolverImpl> Graph;
OpenPOWER on IntegriCloud