Lines Matching refs:G

165   void initializeGraph(PBQPRAGraph &G, VirtRegMap &VRM, Spiller &VRegSpiller);
174 bool mapPBQPToRegAlloc(const PBQPRAGraph &G,
192 void apply(PBQPRAGraph &G) override { in apply() argument
193 LiveIntervals &LIS = G.getMetadata().LIS; in apply()
199 for (auto NId : G.nodeIds()) { in apply()
201 LIS.getInterval(G.getNodeMetadata(NId).getVReg()).weight(); in apply()
206 PBQPRAGraph::RawVector NodeCosts(G.getNodeCosts(NId)); in apply()
208 G.setNodeCosts(NId, std::move(NodeCosts)); in apply()
223 bool haveDisjointAllowedRegs(const PBQPRAGraph &G, PBQPRAGraph::NodeId NId, in haveDisjointAllowedRegs() argument
226 const auto *NRegs = &G.getNodeMetadata(NId).getAllowedRegs(); in haveDisjointAllowedRegs()
227 const auto *MRegs = &G.getNodeMetadata(MId).getAllowedRegs(); in haveDisjointAllowedRegs()
238 void setDisjointAllowedRegs(const PBQPRAGraph &G, PBQPRAGraph::NodeId NId, in setDisjointAllowedRegs() argument
241 const auto *NRegs = &G.getNodeMetadata(NId).getAllowedRegs(); in setDisjointAllowedRegs()
242 const auto *MRegs = &G.getNodeMetadata(MId).getAllowedRegs(); in setDisjointAllowedRegs()
304 void apply(PBQPRAGraph &G) override { in apply() argument
310 LiveIntervals &LIS = G.getMetadata().LIS; in apply()
332 for (auto NId : G.nodeIds()) { in apply()
333 Register VReg = G.getNodeMetadata(NId).getVReg(); in apply()
370 if (haveDisjointAllowedRegs(G, NId, MId, D)) in apply()
379 if (!createInterferenceEdge(G, NId, MId, C)) in apply()
380 setDisjointAllowedRegs(G, NId, MId, D); in apply()
396 bool createInterferenceEdge(PBQPRAGraph &G, in createInterferenceEdge() argument
400 *G.getMetadata().MF.getSubtarget().getRegisterInfo(); in createInterferenceEdge()
401 const auto &NRegs = G.getNodeMetadata(NId).getAllowedRegs(); in createInterferenceEdge()
402 const auto &MRegs = G.getNodeMetadata(MId).getAllowedRegs(); in createInterferenceEdge()
408 G.addEdgeBypassingCostAllocator(NId, MId, I->second); in createInterferenceEdge()
428 PBQPRAGraph::EdgeId EId = G.addEdge(NId, MId, std::move(M)); in createInterferenceEdge()
429 C[K] = G.getEdgeCostsPtr(EId); in createInterferenceEdge()
437 void apply(PBQPRAGraph &G) override { in apply() argument
438 MachineFunction &MF = G.getMetadata().MF; in apply()
439 MachineBlockFrequencyInfo &MBFI = G.getMetadata().MBFI; in apply()
459 PBQPRAGraph::NodeId NId = G.getMetadata().getNodeIdForVReg(SrcReg); in apply()
462 G.getNodeMetadata(NId).getAllowedRegs(); in apply()
469 PBQPRAGraph::RawVector NewCosts(G.getNodeCosts(NId)); in apply()
471 G.setNodeCosts(NId, std::move(NewCosts)); in apply()
474 PBQPRAGraph::NodeId N1Id = G.getMetadata().getNodeIdForVReg(DstReg); in apply()
475 PBQPRAGraph::NodeId N2Id = G.getMetadata().getNodeIdForVReg(SrcReg); in apply()
477 &G.getNodeMetadata(N1Id).getAllowedRegs(); in apply()
479 &G.getNodeMetadata(N2Id).getAllowedRegs(); in apply()
481 PBQPRAGraph::EdgeId EId = G.findEdge(N1Id, N2Id); in apply()
482 if (EId == G.invalidEdgeId()) { in apply()
486 G.addEdge(N1Id, N2Id, std::move(Costs)); in apply()
488 if (G.getEdgeNode1Id(EId) == N2Id) { in apply()
492 PBQPRAGraph::RawMatrix Costs(G.getEdgeCosts(EId)); in apply()
494 G.updateEdgeCosts(EId, std::move(Costs)); in apply()
590 void RegAllocPBQP::initializeGraph(PBQPRAGraph &G, VirtRegMap &VRM, in initializeGraph() argument
592 MachineFunction &MF = G.getMetadata().MF; in initializeGraph()
594 LiveIntervals &LIS = G.getMetadata().LIS; in initializeGraph()
595 const MachineRegisterInfo &MRI = G.getMetadata().MF.getRegInfo(); in initializeGraph()
597 *G.getMetadata().MF.getSubtarget().getRegisterInfo(); in initializeGraph()
682 PBQPRAGraph::NodeId NId = G.addNode(std::move(NodeCosts)); in initializeGraph()
683 G.getNodeMetadata(NId).setVReg(VReg); in initializeGraph()
684 G.getNodeMetadata(NId).setAllowedRegs( in initializeGraph()
685 G.getMetadata().getAllowedRegs(std::move(VRegAllowed))); in initializeGraph()
686 G.getMetadata().setNodeIdForVReg(VReg, NId); in initializeGraph()
716 bool RegAllocPBQP::mapPBQPToRegAlloc(const PBQPRAGraph &G, in mapPBQPToRegAlloc() argument
720 MachineFunction &MF = G.getMetadata().MF; in mapPBQPToRegAlloc()
721 LiveIntervals &LIS = G.getMetadata().LIS; in mapPBQPToRegAlloc()
733 for (auto NId : G.nodeIds()) { in mapPBQPToRegAlloc()
734 Register VReg = G.getNodeMetadata(NId).getVReg(); in mapPBQPToRegAlloc()
738 MCRegister PReg = G.getNodeMetadata(NId).getAllowedRegs()[AllocOpt - 1]; in mapPBQPToRegAlloc()
852 PBQPRAGraph G(PBQPRAGraph::GraphMetadata(MF, LIS, MBFI)); in runOnMachineFunction() local
853 initializeGraph(G, VRM, *VRegSpiller); in runOnMachineFunction()
854 ConstraintsRoot->apply(G); in runOnMachineFunction()
866 G.dump(OS); in runOnMachineFunction()
870 PBQP::Solution Solution = PBQP::RegAlloc::solve(G); in runOnMachineFunction()
871 PBQPAllocComplete = mapPBQPToRegAlloc(G, Solution, VRM, *VRegSpiller); in runOnMachineFunction()
889 const PBQP::RegAlloc::PBQPRAGraph &G) { in PrintNodeInfo() argument
890 return Printable([NId, &G](raw_ostream &OS) { in PrintNodeInfo()
891 const MachineRegisterInfo &MRI = G.getMetadata().MF.getRegInfo(); in PrintNodeInfo()
893 Register VReg = G.getNodeMetadata(NId).getVReg(); in PrintNodeInfo()