Lines Matching refs:G
130 void initializeGraph(PBQPRAGraph &G, VirtRegMap &VRM, Spiller &VRegSpiller);
139 bool mapPBQPToRegAlloc(const PBQPRAGraph &G,
156 void apply(PBQPRAGraph &G) override { in apply() argument
157 LiveIntervals &LIS = G.getMetadata().LIS; in apply()
163 for (auto NId : G.nodeIds()) { in apply()
165 LIS.getInterval(G.getNodeMetadata(NId).getVReg()).weight; in apply()
170 PBQPRAGraph::RawVector NodeCosts(G.getNodeCosts(NId)); in apply()
172 G.setNodeCosts(NId, std::move(NodeCosts)); in apply()
188 bool haveDisjointAllowedRegs(const PBQPRAGraph &G, PBQPRAGraph::NodeId NId, in haveDisjointAllowedRegs() argument
191 const auto *NRegs = &G.getNodeMetadata(NId).getAllowedRegs(); in haveDisjointAllowedRegs()
192 const auto *MRegs = &G.getNodeMetadata(MId).getAllowedRegs(); in haveDisjointAllowedRegs()
203 void setDisjointAllowedRegs(const PBQPRAGraph &G, PBQPRAGraph::NodeId NId, in setDisjointAllowedRegs() argument
206 const auto *NRegs = &G.getNodeMetadata(NId).getAllowedRegs(); in setDisjointAllowedRegs()
207 const auto *MRegs = &G.getNodeMetadata(MId).getAllowedRegs(); in setDisjointAllowedRegs()
270 void apply(PBQPRAGraph &G) override { in apply() argument
276 LiveIntervals &LIS = G.getMetadata().LIS; in apply()
297 for (auto NId : G.nodeIds()) { in apply()
298 unsigned VReg = G.getNodeMetadata(NId).getVReg(); in apply()
335 if (haveDisjointAllowedRegs(G, NId, MId, D)) in apply()
344 if (!createInterferenceEdge(G, NId, MId, C)) in apply()
345 setDisjointAllowedRegs(G, NId, MId, D); in apply()
362 bool createInterferenceEdge(PBQPRAGraph &G, in createInterferenceEdge() argument
367 *G.getMetadata().MF.getSubtarget().getRegisterInfo(); in createInterferenceEdge()
368 const auto &NRegs = G.getNodeMetadata(NId).getAllowedRegs(); in createInterferenceEdge()
369 const auto &MRegs = G.getNodeMetadata(MId).getAllowedRegs(); in createInterferenceEdge()
375 G.addEdgeBypassingCostAllocator(NId, MId, I->second); in createInterferenceEdge()
395 PBQPRAGraph::EdgeId EId = G.addEdge(NId, MId, std::move(M)); in createInterferenceEdge()
396 C[K] = G.getEdgeCostsPtr(EId); in createInterferenceEdge()
405 void apply(PBQPRAGraph &G) override { in apply() argument
406 MachineFunction &MF = G.getMetadata().MF; in apply()
407 MachineBlockFrequencyInfo &MBFI = G.getMetadata().MBFI; in apply()
429 PBQPRAGraph::NodeId NId = G.getMetadata().getNodeIdForVReg(SrcReg); in apply()
432 G.getNodeMetadata(NId).getAllowedRegs(); in apply()
439 PBQPRAGraph::RawVector NewCosts(G.getNodeCosts(NId)); in apply()
441 G.setNodeCosts(NId, std::move(NewCosts)); in apply()
444 PBQPRAGraph::NodeId N1Id = G.getMetadata().getNodeIdForVReg(DstReg); in apply()
445 PBQPRAGraph::NodeId N2Id = G.getMetadata().getNodeIdForVReg(SrcReg); in apply()
447 &G.getNodeMetadata(N1Id).getAllowedRegs(); in apply()
449 &G.getNodeMetadata(N2Id).getAllowedRegs(); in apply()
451 PBQPRAGraph::EdgeId EId = G.findEdge(N1Id, N2Id); in apply()
452 if (EId == G.invalidEdgeId()) { in apply()
456 G.addEdge(N1Id, N2Id, std::move(Costs)); in apply()
458 if (G.getEdgeNode1Id(EId) == N2Id) { in apply()
462 PBQPRAGraph::RawMatrix Costs(G.getEdgeCosts(EId)); in apply()
464 G.updateEdgeCosts(EId, std::move(Costs)); in apply()
554 void RegAllocPBQP::initializeGraph(PBQPRAGraph &G, VirtRegMap &VRM, in initializeGraph() argument
556 MachineFunction &MF = G.getMetadata().MF; in initializeGraph()
558 LiveIntervals &LIS = G.getMetadata().LIS; in initializeGraph()
559 const MachineRegisterInfo &MRI = G.getMetadata().MF.getRegInfo(); in initializeGraph()
561 *G.getMetadata().MF.getSubtarget().getRegisterInfo(); in initializeGraph()
620 PBQPRAGraph::NodeId NId = G.addNode(std::move(NodeCosts)); in initializeGraph()
621 G.getNodeMetadata(NId).setVReg(VReg); in initializeGraph()
622 G.getNodeMetadata(NId).setAllowedRegs( in initializeGraph()
623 G.getMetadata().getAllowedRegs(std::move(VRegAllowed))); in initializeGraph()
624 G.getMetadata().setNodeIdForVReg(VReg, NId); in initializeGraph()
655 bool RegAllocPBQP::mapPBQPToRegAlloc(const PBQPRAGraph &G, in mapPBQPToRegAlloc() argument
659 MachineFunction &MF = G.getMetadata().MF; in mapPBQPToRegAlloc()
660 LiveIntervals &LIS = G.getMetadata().LIS; in mapPBQPToRegAlloc()
672 for (auto NId : G.nodeIds()) { in mapPBQPToRegAlloc()
673 unsigned VReg = G.getNodeMetadata(NId).getVReg(); in mapPBQPToRegAlloc()
677 unsigned PReg = G.getNodeMetadata(NId).getAllowedRegs()[AllocOption - 1]; in mapPBQPToRegAlloc()
775 PBQPRAGraph G(PBQPRAGraph::GraphMetadata(MF, LIS, MBFI)); in runOnMachineFunction() local
776 initializeGraph(G, VRM, *VRegSpiller); in runOnMachineFunction()
777 ConstraintsRoot->apply(G); in runOnMachineFunction()
789 G.dump(OS); in runOnMachineFunction()
793 PBQP::Solution Solution = PBQP::RegAlloc::solve(G); in runOnMachineFunction()
794 PBQPAllocComplete = mapPBQPToRegAlloc(G, Solution, VRM, *VRegSpiller); in runOnMachineFunction()
811 const PBQP::RegAlloc::PBQPRAGraph &G) { in PrintNodeInfo() argument
812 return Printable([NId, &G](raw_ostream &OS) { in PrintNodeInfo()
813 const MachineRegisterInfo &MRI = G.getMetadata().MF.getRegInfo(); in PrintNodeInfo()
815 unsigned VReg = G.getNodeMetadata(NId).getVReg(); in PrintNodeInfo()