Lines Matching refs:G
129 void initializeGraph(PBQPRAGraph &G, VirtRegMap &VRM, Spiller &VRegSpiller);
138 bool mapPBQPToRegAlloc(const PBQPRAGraph &G,
155 void apply(PBQPRAGraph &G) override { in apply() argument
156 LiveIntervals &LIS = G.getMetadata().LIS; in apply()
162 for (auto NId : G.nodeIds()) { in apply()
164 LIS.getInterval(G.getNodeMetadata(NId).getVReg()).weight; in apply()
169 PBQPRAGraph::RawVector NodeCosts(G.getNodeCosts(NId)); in apply()
171 G.setNodeCosts(NId, std::move(NodeCosts)); in apply()
187 bool haveDisjointAllowedRegs(const PBQPRAGraph &G, PBQPRAGraph::NodeId NId, in haveDisjointAllowedRegs() argument
190 const auto *NRegs = &G.getNodeMetadata(NId).getAllowedRegs(); in haveDisjointAllowedRegs()
191 const auto *MRegs = &G.getNodeMetadata(MId).getAllowedRegs(); in haveDisjointAllowedRegs()
202 void setDisjointAllowedRegs(const PBQPRAGraph &G, PBQPRAGraph::NodeId NId, in setDisjointAllowedRegs() argument
205 const auto *NRegs = &G.getNodeMetadata(NId).getAllowedRegs(); in setDisjointAllowedRegs()
206 const auto *MRegs = &G.getNodeMetadata(MId).getAllowedRegs(); in setDisjointAllowedRegs()
269 void apply(PBQPRAGraph &G) override { in apply() argument
275 LiveIntervals &LIS = G.getMetadata().LIS; in apply()
296 for (auto NId : G.nodeIds()) { in apply()
297 unsigned VReg = G.getNodeMetadata(NId).getVReg(); in apply()
334 if (haveDisjointAllowedRegs(G, NId, MId, D)) in apply()
343 if (!createInterferenceEdge(G, NId, MId, C)) in apply()
344 setDisjointAllowedRegs(G, NId, MId, D); in apply()
361 bool createInterferenceEdge(PBQPRAGraph &G, in createInterferenceEdge() argument
366 *G.getMetadata().MF.getSubtarget().getRegisterInfo(); in createInterferenceEdge()
367 const auto &NRegs = G.getNodeMetadata(NId).getAllowedRegs(); in createInterferenceEdge()
368 const auto &MRegs = G.getNodeMetadata(MId).getAllowedRegs(); in createInterferenceEdge()
374 G.addEdgeBypassingCostAllocator(NId, MId, I->second); in createInterferenceEdge()
394 PBQPRAGraph::EdgeId EId = G.addEdge(NId, MId, std::move(M)); in createInterferenceEdge()
395 C[K] = G.getEdgeCostsPtr(EId); in createInterferenceEdge()
404 void apply(PBQPRAGraph &G) override { in apply() argument
405 MachineFunction &MF = G.getMetadata().MF; in apply()
406 MachineBlockFrequencyInfo &MBFI = G.getMetadata().MBFI; in apply()
428 PBQPRAGraph::NodeId NId = G.getMetadata().getNodeIdForVReg(SrcReg); in apply()
431 G.getNodeMetadata(NId).getAllowedRegs(); in apply()
438 PBQPRAGraph::RawVector NewCosts(G.getNodeCosts(NId)); in apply()
440 G.setNodeCosts(NId, std::move(NewCosts)); in apply()
443 PBQPRAGraph::NodeId N1Id = G.getMetadata().getNodeIdForVReg(DstReg); in apply()
444 PBQPRAGraph::NodeId N2Id = G.getMetadata().getNodeIdForVReg(SrcReg); in apply()
446 &G.getNodeMetadata(N1Id).getAllowedRegs(); in apply()
448 &G.getNodeMetadata(N2Id).getAllowedRegs(); in apply()
450 PBQPRAGraph::EdgeId EId = G.findEdge(N1Id, N2Id); in apply()
451 if (EId == G.invalidEdgeId()) { in apply()
455 G.addEdge(N1Id, N2Id, std::move(Costs)); in apply()
457 if (G.getEdgeNode1Id(EId) == N2Id) { in apply()
461 PBQPRAGraph::RawMatrix Costs(G.getEdgeCosts(EId)); in apply()
463 G.updateEdgeCosts(EId, std::move(Costs)); in apply()
553 void RegAllocPBQP::initializeGraph(PBQPRAGraph &G, VirtRegMap &VRM, in initializeGraph() argument
555 MachineFunction &MF = G.getMetadata().MF; in initializeGraph()
557 LiveIntervals &LIS = G.getMetadata().LIS; in initializeGraph()
558 const MachineRegisterInfo &MRI = G.getMetadata().MF.getRegInfo(); in initializeGraph()
560 *G.getMetadata().MF.getSubtarget().getRegisterInfo(); in initializeGraph()
619 PBQPRAGraph::NodeId NId = G.addNode(std::move(NodeCosts)); in initializeGraph()
620 G.getNodeMetadata(NId).setVReg(VReg); in initializeGraph()
621 G.getNodeMetadata(NId).setAllowedRegs( in initializeGraph()
622 G.getMetadata().getAllowedRegs(std::move(VRegAllowed))); in initializeGraph()
623 G.getMetadata().setNodeIdForVReg(VReg, NId); in initializeGraph()
654 bool RegAllocPBQP::mapPBQPToRegAlloc(const PBQPRAGraph &G, in mapPBQPToRegAlloc() argument
658 MachineFunction &MF = G.getMetadata().MF; in mapPBQPToRegAlloc()
659 LiveIntervals &LIS = G.getMetadata().LIS; in mapPBQPToRegAlloc()
671 for (auto NId : G.nodeIds()) { in mapPBQPToRegAlloc()
672 unsigned VReg = G.getNodeMetadata(NId).getVReg(); in mapPBQPToRegAlloc()
676 unsigned PReg = G.getNodeMetadata(NId).getAllowedRegs()[AllocOption - 1]; in mapPBQPToRegAlloc()
774 PBQPRAGraph G(PBQPRAGraph::GraphMetadata(MF, LIS, MBFI)); in runOnMachineFunction() local
775 initializeGraph(G, VRM, *VRegSpiller); in runOnMachineFunction()
776 ConstraintsRoot->apply(G); in runOnMachineFunction()
788 G.dump(OS); in runOnMachineFunction()
792 PBQP::Solution Solution = PBQP::RegAlloc::solve(G); in runOnMachineFunction()
793 PBQPAllocComplete = mapPBQPToRegAlloc(G, Solution, VRM, *VRegSpiller); in runOnMachineFunction()
815 PrintNodeInfo(NodeId NId, const Graph &G) : G(G), NId(NId) {} in PrintNodeInfo() argument
818 const MachineRegisterInfo &MRI = G.getMetadata().MF.getRegInfo(); in print()
820 unsigned VReg = G.getNodeMetadata(NId).getVReg(); in print()
826 const Graph &G; member in __anon4cb6f5b20211::PrintNodeInfo