Lines Matching refs:CP
153 bool joinIntervals(CoalescerPair &CP);
156 bool joinVirtRegs(CoalescerPair &CP);
159 bool joinReservedPhysReg(CoalescerPair &CP);
167 LaneBitmask LaneMask, CoalescerPair &CP);
172 LaneBitmask LaneMask, const CoalescerPair &CP);
178 bool adjustCopiesBackFrom(const CoalescerPair &CP, MachineInstr *CopyMI);
190 bool removeCopyByCommutingDef(const CoalescerPair &CP,MachineInstr *CopyMI);
194 bool reMaterializeTrivialDef(const CoalescerPair &CP, MachineInstr *CopyMI,
198 bool canJoinPhys(const CoalescerPair &CP);
461 bool RegisterCoalescer::adjustCopiesBackFrom(const CoalescerPair &CP,
463 assert(!CP.isPartial() && "This doesn't work for partial copies.");
464 assert(!CP.isPhys() && "This doesn't work for physreg copies.");
467 LIS->getInterval(CP.isFlipped() ? CP.getDstReg() : CP.getSrcReg());
469 LIS->getInterval(CP.isFlipped() ? CP.getSrcReg() : CP.getDstReg());
508 if (!CP.isCoalescable(ACopyMI) || !ACopyMI->isFullCopy())
614 bool RegisterCoalescer::removeCopyByCommutingDef(const CoalescerPair &CP,
616 assert(!CP.isPhys());
619 LIS->getInterval(CP.isFlipped() ? CP.getDstReg() : CP.getSrcReg());
621 LIS->getInterval(CP.isFlipped() ? CP.getSrcReg() : CP.getDstReg());
870 bool RegisterCoalescer::reMaterializeTrivialDef(const CoalescerPair &CP,
874 unsigned SrcReg = CP.isFlipped() ? CP.getDstReg() : CP.getSrcReg();
875 unsigned SrcIdx = CP.isFlipped() ? CP.getDstIdx() : CP.getSrcIdx();
876 unsigned DstReg = CP.isFlipped() ? CP.getSrcReg() : CP.getDstReg();
877 unsigned DstIdx = CP.isFlipped() ? CP.getSrcIdx() : CP.getDstIdx();
925 unsigned NewDstIdx = TRI->composeSubRegIndices(CP.getSrcIdx(),
953 const TargetRegisterClass *NewRC = CP.getNewRC();
957 assert(SrcIdx == 0 && CP.isFlipped()
1250 bool RegisterCoalescer::canJoinPhys(const CoalescerPair &CP) {
1254 if (!MRI->isReserved(CP.getDstReg())) {
1259 LiveInterval &JoinVInt = LIS->getInterval(CP.getSrcReg());
1272 CoalescerPair CP(*TRI);
1273 if (!CP.setRegisters(CopyMI)) {
1278 if (CP.getNewRC()) {
1279 auto SrcRC = MRI->getRegClass(CP.getSrcReg());
1280 auto DstRC = MRI->getRegClass(CP.getDstReg());
1281 unsigned SrcIdx = CP.getSrcIdx();
1282 unsigned DstIdx = CP.getDstIdx();
1283 if (CP.isFlipped()) {
1288 CP.getNewRC())) {
1297 if (!CP.isPhys() && CopyMI->allDefsAreDead()) {
1305 if (!CP.isPhys() && eliminateUndefCopy(CopyMI)) {
1314 if (CP.getSrcReg() == CP.getDstReg()) {
1315 LiveInterval &LI = LIS->getInterval(CP.getSrcReg());
1341 if (CP.isPhys()) {
1342 DEBUG(dbgs() << "\tConsidering merging " << PrintReg(CP.getSrcReg(), TRI)
1343 << " with " << PrintReg(CP.getDstReg(), TRI, CP.getSrcIdx())
1345 if (!canJoinPhys(CP)) {
1349 if (reMaterializeTrivialDef(CP, CopyMI, IsDefCopy))
1357 if (!CP.isPartial() && LIS->getInterval(CP.getSrcReg()).size() >
1358 LIS->getInterval(CP.getDstReg()).size())
1359 CP.flip();
1363 << TRI->getRegClassName(CP.getNewRC()) << " with ";
1364 if (CP.getDstIdx() && CP.getSrcIdx())
1365 dbgs() << PrintReg(CP.getDstReg()) << " in "
1366 << TRI->getSubRegIndexName(CP.getDstIdx()) << " and "
1367 << PrintReg(CP.getSrcReg()) << " in "
1368 << TRI->getSubRegIndexName(CP.getSrcIdx()) << '\n';
1370 dbgs() << PrintReg(CP.getSrcReg(), TRI) << " in "
1371 << PrintReg(CP.getDstReg(), TRI, CP.getSrcIdx()) << '\n';
1382 if (!joinIntervals(CP)) {
1388 if (reMaterializeTrivialDef(CP, CopyMI, IsDefCopy))
1393 if (!CP.isPartial() && !CP.isPhys()) {
1394 if (adjustCopiesBackFrom(CP, CopyMI) ||
1395 removeCopyByCommutingDef(CP, CopyMI)) {
1411 if (CP.isCrossClass()) {
1413 MRI->setRegClass(CP.getDstReg(), CP.getNewRC());
1418 if (!CP.isPhys() && RegClassInfo.isProperSubClass(CP.getNewRC()))
1419 InflateRegs.push_back(CP.getDstReg());
1428 if (CP.getDstIdx())
1429 updateRegDefsUses(CP.getDstReg(), CP.getDstReg(), CP.getDstIdx());
1430 updateRegDefsUses(CP.getSrcReg(), CP.getDstReg(), CP.getSrcIdx());
1434 LiveInterval &LI = LIS->getInterval(CP.getDstReg());
1445 LiveInterval &LI = LIS->getInterval(CP.getDstReg());
1451 LIS->removeInterval(CP.getSrcReg());
1454 TRI->updateRegAllocHint(CP.getSrcReg(), CP.getDstReg(), *MF);
1457 dbgs() << "\tSuccess: " << PrintReg(CP.getSrcReg(), TRI, CP.getSrcIdx())
1458 << " -> " << PrintReg(CP.getDstReg(), TRI, CP.getDstIdx()) << '\n';
1460 if (CP.isPhys())
1461 dbgs() << PrintReg(CP.getDstReg(), TRI);
1463 dbgs() << LIS->getInterval(CP.getDstReg());
1471 bool RegisterCoalescer::joinReservedPhysReg(CoalescerPair &CP) {
1472 unsigned DstReg = CP.getDstReg();
1473 assert(CP.isPhys() && "Must be a physreg copy");
1475 LiveInterval &RHS = LIS->getInterval(CP.getSrcReg());
1500 if (CP.isFlipped()) {
1551 MRI->clearKillFlags(CP.getSrcReg());
1632 /// subregister SubIdx in the coalesced register. Either CP.DstIdx or
1633 /// CP.SrcIdx.
1648 const CoalescerPair &CP;
1790 SmallVectorImpl<VNInfo*> &newVNInfo, const CoalescerPair &cp,
1795 NewVNInfo(newVNInfo), CP(cp), LIS(lis), Indexes(LIS->getSlotIndexes()),
2055 if (CP.isCoalescable(DefMI)) {
2072 if (DefMI->isFullCopy() && !CP.isPartial()
2455 Reg != CP.getSrcReg() && Reg != CP.getDstReg())
2472 const CoalescerPair &CP) {
2474 JoinVals RHSVals(RRange, CP.getSrcReg(), CP.getSrcIdx(), LaneMask,
2475 NewVNInfo, CP, LIS, TRI, true, true);
2476 JoinVals LHSVals(LRange, CP.getDstReg(), CP.getDstIdx(), LaneMask,
2477 NewVNInfo, CP, LIS, TRI, true, true);
2528 CoalescerPair &CP) {
2555 joinSubRegRanges(*CommonRange, RangeCopy, Common, CP);
2565 bool RegisterCoalescer::joinVirtRegs(CoalescerPair &CP) {
2567 LiveInterval &RHS = LIS->getInterval(CP.getSrcReg());
2568 LiveInterval &LHS = LIS->getInterval(CP.getDstReg());
2569 bool TrackSubRegLiveness = MRI->shouldTrackSubRegLiveness(*CP.getNewRC());
2570 JoinVals RHSVals(RHS, CP.getSrcReg(), CP.getSrcIdx(), 0, NewVNInfo, CP, LIS,
2572 JoinVals LHSVals(LHS, CP.getDstReg(), CP.getDstIdx(), 0, NewVNInfo, CP, LIS,
2594 unsigned DstIdx = CP.getDstIdx();
2596 LaneBitmask Mask = DstIdx == 0 ? CP.getNewRC()->getLaneMask()
2608 DEBUG(dbgs() << "\t\tLHST = " << PrintReg(CP.getDstReg())
2612 unsigned SrcIdx = CP.getSrcIdx();
2614 LaneBitmask Mask = SrcIdx == 0 ? CP.getNewRC()->getLaneMask()
2616 mergeSubRangeInto(LHS, RHS, Mask, CP);
2621 mergeSubRangeInto(LHS, R, Mask, CP);
2666 bool RegisterCoalescer::joinIntervals(CoalescerPair &CP) {
2667 return CP.isPhys() ? joinReservedPhysReg(CP) : joinVirtRegs(CP);