Lines Matching refs:PBQP
10 // This file defines the PBQPBuilder interface, for classes which build PBQP
21 #include "llvm/CodeGen/PBQP/Graph.h"
22 #include "llvm/CodeGen/PBQP/Solution.h"
34 /// This class wraps up a PBQP instance representing a register allocation
35 /// problem, plus the structures necessary to map back from the PBQP solution
36 /// to a register allocation solution. (i.e. The PBQP-node <--> vreg map,
37 /// and the PBQP option <--> storage location map).
44 PBQP::Graph& getGraph() { return graph; }
46 const PBQP::Graph& getGraph() const { return graph; }
48 /// Record the mapping between the given virtual register and PBQP node,
55 void recordVReg(unsigned vreg, PBQP::Graph::NodeItr node,
66 /// Get the virtual register corresponding to the given PBQP node.
67 unsigned getVRegForNode(PBQP::Graph::ConstNodeItr node) const;
69 /// Get the PBQP node corresponding to the given virtual register.
70 PBQP::Graph::NodeItr getNodeForVReg(unsigned vreg) const;
72 /// Returns true if the given PBQP option represents a physical register,
80 /// Returns true if the given PBQP option represents spilling, false
95 typedef std::map<PBQP::Graph::ConstNodeItr, unsigned,
96 PBQP::NodeItrComparator> Node2VReg;
97 typedef DenseMap<unsigned, PBQP::Graph::NodeItr> VReg2Node;
100 PBQP::Graph graph;
108 /// Builds PBQP instances to represent register allocation problems. Includes
125 /// Build a PBQP instance to represent the register allocation problem for
132 void addSpillCosts(PBQP::Vector &costVec, PBQP::PBQPNum spillCost);
134 void addInterferenceCosts(PBQP::Matrix &costMat,
144 /// Build a PBQP instance to represent the register allocation problem for
152 void addPhysRegCoalesce(PBQP::Vector &costVec, unsigned pregOption,
153 PBQP::PBQPNum benefit);
155 void addVirtRegCoalesce(PBQP::Matrix &costMat,
158 PBQP::PBQPNum benefit);