• Home
  • Raw
  • Download

Lines Matching refs:G

136   void initializeGraph(PBQPRAGraph &G, VirtRegMap &VRM, Spiller &VRegSpiller);
145 bool mapPBQPToRegAlloc(const PBQPRAGraph &G,
163 void apply(PBQPRAGraph &G) override { in apply() argument
164 LiveIntervals &LIS = G.getMetadata().LIS; in apply()
170 for (auto NId : G.nodeIds()) { in apply()
172 LIS.getInterval(G.getNodeMetadata(NId).getVReg()).weight; in apply()
177 PBQPRAGraph::RawVector NodeCosts(G.getNodeCosts(NId)); in apply()
179 G.setNodeCosts(NId, std::move(NodeCosts)); in apply()
195 bool haveDisjointAllowedRegs(const PBQPRAGraph &G, PBQPRAGraph::NodeId NId, in haveDisjointAllowedRegs() argument
198 const auto *NRegs = &G.getNodeMetadata(NId).getAllowedRegs(); in haveDisjointAllowedRegs()
199 const auto *MRegs = &G.getNodeMetadata(MId).getAllowedRegs(); in haveDisjointAllowedRegs()
210 void setDisjointAllowedRegs(const PBQPRAGraph &G, PBQPRAGraph::NodeId NId, in setDisjointAllowedRegs() argument
213 const auto *NRegs = &G.getNodeMetadata(NId).getAllowedRegs(); in setDisjointAllowedRegs()
214 const auto *MRegs = &G.getNodeMetadata(MId).getAllowedRegs(); in setDisjointAllowedRegs()
277 void apply(PBQPRAGraph &G) override { in apply() argument
283 LiveIntervals &LIS = G.getMetadata().LIS; in apply()
304 for (auto NId : G.nodeIds()) { in apply()
305 unsigned VReg = G.getNodeMetadata(NId).getVReg(); in apply()
342 if (haveDisjointAllowedRegs(G, NId, MId, D)) in apply()
351 if (!createInterferenceEdge(G, NId, MId, C)) in apply()
352 setDisjointAllowedRegs(G, NId, MId, D); in apply()
369 bool createInterferenceEdge(PBQPRAGraph &G, in createInterferenceEdge() argument
374 *G.getMetadata().MF.getSubtarget().getRegisterInfo(); in createInterferenceEdge()
375 const auto &NRegs = G.getNodeMetadata(NId).getAllowedRegs(); in createInterferenceEdge()
376 const auto &MRegs = G.getNodeMetadata(MId).getAllowedRegs(); in createInterferenceEdge()
382 G.addEdgeBypassingCostAllocator(NId, MId, I->second); in createInterferenceEdge()
402 PBQPRAGraph::EdgeId EId = G.addEdge(NId, MId, std::move(M)); in createInterferenceEdge()
403 C[K] = G.getEdgeCostsPtr(EId); in createInterferenceEdge()
412 void apply(PBQPRAGraph &G) override { in apply() argument
413 MachineFunction &MF = G.getMetadata().MF; in apply()
414 MachineBlockFrequencyInfo &MBFI = G.getMetadata().MBFI; in apply()
436 PBQPRAGraph::NodeId NId = G.getMetadata().getNodeIdForVReg(SrcReg); in apply()
439 G.getNodeMetadata(NId).getAllowedRegs(); in apply()
446 PBQPRAGraph::RawVector NewCosts(G.getNodeCosts(NId)); in apply()
448 G.setNodeCosts(NId, std::move(NewCosts)); in apply()
451 PBQPRAGraph::NodeId N1Id = G.getMetadata().getNodeIdForVReg(DstReg); in apply()
452 PBQPRAGraph::NodeId N2Id = G.getMetadata().getNodeIdForVReg(SrcReg); in apply()
454 &G.getNodeMetadata(N1Id).getAllowedRegs(); in apply()
456 &G.getNodeMetadata(N2Id).getAllowedRegs(); in apply()
458 PBQPRAGraph::EdgeId EId = G.findEdge(N1Id, N2Id); in apply()
459 if (EId == G.invalidEdgeId()) { in apply()
463 G.addEdge(N1Id, N2Id, std::move(Costs)); in apply()
465 if (G.getEdgeNode1Id(EId) == N2Id) { in apply()
469 PBQPRAGraph::RawMatrix Costs(G.getEdgeCosts(EId)); in apply()
471 G.updateEdgeCosts(EId, std::move(Costs)); in apply()
561 void RegAllocPBQP::initializeGraph(PBQPRAGraph &G, VirtRegMap &VRM, in initializeGraph() argument
563 MachineFunction &MF = G.getMetadata().MF; in initializeGraph()
565 LiveIntervals &LIS = G.getMetadata().LIS; in initializeGraph()
566 const MachineRegisterInfo &MRI = G.getMetadata().MF.getRegInfo(); in initializeGraph()
568 *G.getMetadata().MF.getSubtarget().getRegisterInfo(); in initializeGraph()
627 PBQPRAGraph::NodeId NId = G.addNode(std::move(NodeCosts)); in initializeGraph()
628 G.getNodeMetadata(NId).setVReg(VReg); in initializeGraph()
629 G.getNodeMetadata(NId).setAllowedRegs( in initializeGraph()
630 G.getMetadata().getAllowedRegs(std::move(VRegAllowed))); in initializeGraph()
631 G.getMetadata().setNodeIdForVReg(VReg, NId); in initializeGraph()
663 bool RegAllocPBQP::mapPBQPToRegAlloc(const PBQPRAGraph &G, in mapPBQPToRegAlloc() argument
667 MachineFunction &MF = G.getMetadata().MF; in mapPBQPToRegAlloc()
668 LiveIntervals &LIS = G.getMetadata().LIS; in mapPBQPToRegAlloc()
680 for (auto NId : G.nodeIds()) { in mapPBQPToRegAlloc()
681 unsigned VReg = G.getNodeMetadata(NId).getVReg(); in mapPBQPToRegAlloc()
685 unsigned PReg = G.getNodeMetadata(NId).getAllowedRegs()[AllocOption - 1]; in mapPBQPToRegAlloc()
793 PBQPRAGraph G(PBQPRAGraph::GraphMetadata(MF, LIS, MBFI)); in runOnMachineFunction() local
794 initializeGraph(G, VRM, *VRegSpiller); in runOnMachineFunction()
795 ConstraintsRoot->apply(G); in runOnMachineFunction()
807 G.dump(OS); in runOnMachineFunction()
811 PBQP::Solution Solution = PBQP::RegAlloc::solve(G); in runOnMachineFunction()
812 PBQPAllocComplete = mapPBQPToRegAlloc(G, Solution, VRM, *VRegSpiller); in runOnMachineFunction()
830 const PBQP::RegAlloc::PBQPRAGraph &G) { in PrintNodeInfo() argument
831 return Printable([NId, &G](raw_ostream &OS) { in PrintNodeInfo()
832 const MachineRegisterInfo &MRI = G.getMetadata().MF.getRegInfo(); in PrintNodeInfo()
834 unsigned VReg = G.getNodeMetadata(NId).getVReg(); in PrintNodeInfo()