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);
471 bool RegisterCoalescer::adjustCopiesBackFrom(const CoalescerPair &CP, in adjustCopiesBackFrom() argument
473 assert(!CP.isPartial() && "This doesn't work for partial copies."); in adjustCopiesBackFrom()
474 assert(!CP.isPhys() && "This doesn't work for physreg copies."); in adjustCopiesBackFrom()
477 LIS->getInterval(CP.isFlipped() ? CP.getDstReg() : CP.getSrcReg()); in adjustCopiesBackFrom()
479 LIS->getInterval(CP.isFlipped() ? CP.getSrcReg() : CP.getDstReg()); in adjustCopiesBackFrom()
518 if (!CP.isCoalescable(ACopyMI) || !ACopyMI->isFullCopy()) in adjustCopiesBackFrom()
624 bool RegisterCoalescer::removeCopyByCommutingDef(const CoalescerPair &CP, in removeCopyByCommutingDef() argument
626 assert(!CP.isPhys()); in removeCopyByCommutingDef()
629 LIS->getInterval(CP.isFlipped() ? CP.getDstReg() : CP.getSrcReg()); in removeCopyByCommutingDef()
631 LIS->getInterval(CP.isFlipped() ? CP.getSrcReg() : CP.getDstReg()); in removeCopyByCommutingDef()
880 bool RegisterCoalescer::reMaterializeTrivialDef(const CoalescerPair &CP, in reMaterializeTrivialDef() argument
884 unsigned SrcReg = CP.isFlipped() ? CP.getDstReg() : CP.getSrcReg(); in reMaterializeTrivialDef()
885 unsigned SrcIdx = CP.isFlipped() ? CP.getDstIdx() : CP.getSrcIdx(); in reMaterializeTrivialDef()
886 unsigned DstReg = CP.isFlipped() ? CP.getSrcReg() : CP.getDstReg(); in reMaterializeTrivialDef()
887 unsigned DstIdx = CP.isFlipped() ? CP.getSrcIdx() : CP.getDstIdx(); in reMaterializeTrivialDef()
935 unsigned NewDstIdx = TRI->composeSubRegIndices(CP.getSrcIdx(), in reMaterializeTrivialDef()
965 const TargetRegisterClass *NewRC = CP.getNewRC(); in reMaterializeTrivialDef()
969 assert(SrcIdx == 0 && CP.isFlipped() in reMaterializeTrivialDef()
1324 bool RegisterCoalescer::canJoinPhys(const CoalescerPair &CP) { in canJoinPhys() argument
1328 if (!MRI->isReserved(CP.getDstReg())) { in canJoinPhys()
1333 LiveInterval &JoinVInt = LIS->getInterval(CP.getSrcReg()); in canJoinPhys()
1346 CoalescerPair CP(*TRI); in joinCopy() local
1347 if (!CP.setRegisters(CopyMI)) { in joinCopy()
1352 if (CP.getNewRC()) { in joinCopy()
1353 auto SrcRC = MRI->getRegClass(CP.getSrcReg()); in joinCopy()
1354 auto DstRC = MRI->getRegClass(CP.getDstReg()); in joinCopy()
1355 unsigned SrcIdx = CP.getSrcIdx(); in joinCopy()
1356 unsigned DstIdx = CP.getDstIdx(); in joinCopy()
1357 if (CP.isFlipped()) { in joinCopy()
1362 CP.getNewRC())) { in joinCopy()
1371 if (!CP.isPhys() && CopyMI->allDefsAreDead()) { in joinCopy()
1379 if (!CP.isPhys() && eliminateUndefCopy(CopyMI)) { in joinCopy()
1388 if (CP.getSrcReg() == CP.getDstReg()) { in joinCopy()
1389 LiveInterval &LI = LIS->getInterval(CP.getSrcReg()); in joinCopy()
1415 if (CP.isPhys()) { in joinCopy()
1416 DEBUG(dbgs() << "\tConsidering merging " << PrintReg(CP.getSrcReg(), TRI) in joinCopy()
1417 << " with " << PrintReg(CP.getDstReg(), TRI, CP.getSrcIdx()) in joinCopy()
1419 if (!canJoinPhys(CP)) { in joinCopy()
1423 if (reMaterializeTrivialDef(CP, CopyMI, IsDefCopy)) in joinCopy()
1431 if (!CP.isPartial() && LIS->getInterval(CP.getSrcReg()).size() > in joinCopy()
1432 LIS->getInterval(CP.getDstReg()).size()) in joinCopy()
1433 CP.flip(); in joinCopy()
1437 << TRI->getRegClassName(CP.getNewRC()) << " with "; in joinCopy()
1438 if (CP.getDstIdx() && CP.getSrcIdx()) in joinCopy()
1439 dbgs() << PrintReg(CP.getDstReg()) << " in " in joinCopy()
1440 << TRI->getSubRegIndexName(CP.getDstIdx()) << " and " in joinCopy()
1441 << PrintReg(CP.getSrcReg()) << " in " in joinCopy()
1442 << TRI->getSubRegIndexName(CP.getSrcIdx()) << '\n'; in joinCopy()
1444 dbgs() << PrintReg(CP.getSrcReg(), TRI) << " in " in joinCopy()
1445 << PrintReg(CP.getDstReg(), TRI, CP.getSrcIdx()) << '\n'; in joinCopy()
1456 if (!joinIntervals(CP)) { in joinCopy()
1462 if (reMaterializeTrivialDef(CP, CopyMI, IsDefCopy)) in joinCopy()
1467 if (!CP.isPartial() && !CP.isPhys()) { in joinCopy()
1468 if (adjustCopiesBackFrom(CP, CopyMI) || in joinCopy()
1469 removeCopyByCommutingDef(CP, CopyMI)) { in joinCopy()
1485 if (CP.isCrossClass()) { in joinCopy()
1487 MRI->setRegClass(CP.getDstReg(), CP.getNewRC()); in joinCopy()
1492 if (!CP.isPhys() && RegClassInfo.isProperSubClass(CP.getNewRC())) in joinCopy()
1493 InflateRegs.push_back(CP.getDstReg()); in joinCopy()
1502 if (CP.getDstIdx()) in joinCopy()
1503 updateRegDefsUses(CP.getDstReg(), CP.getDstReg(), CP.getDstIdx()); in joinCopy()
1504 updateRegDefsUses(CP.getSrcReg(), CP.getDstReg(), CP.getSrcIdx()); in joinCopy()
1508 LiveInterval &LI = LIS->getInterval(CP.getDstReg()); in joinCopy()
1519 LiveInterval &LI = LIS->getInterval(CP.getDstReg()); in joinCopy()
1525 LIS->removeInterval(CP.getSrcReg()); in joinCopy()
1528 TRI->updateRegAllocHint(CP.getSrcReg(), CP.getDstReg(), *MF); in joinCopy()
1531 dbgs() << "\tSuccess: " << PrintReg(CP.getSrcReg(), TRI, CP.getSrcIdx()) in joinCopy()
1532 << " -> " << PrintReg(CP.getDstReg(), TRI, CP.getDstIdx()) << '\n'; in joinCopy()
1534 if (CP.isPhys()) in joinCopy()
1535 dbgs() << PrintReg(CP.getDstReg(), TRI); in joinCopy()
1537 dbgs() << LIS->getInterval(CP.getDstReg()); in joinCopy()
1545 bool RegisterCoalescer::joinReservedPhysReg(CoalescerPair &CP) { in joinReservedPhysReg() argument
1546 unsigned DstReg = CP.getDstReg(); in joinReservedPhysReg()
1547 assert(CP.isPhys() && "Must be a physreg copy"); in joinReservedPhysReg()
1549 LiveInterval &RHS = LIS->getInterval(CP.getSrcReg()); in joinReservedPhysReg()
1574 if (CP.isFlipped()) { in joinReservedPhysReg()
1625 MRI->clearKillFlags(CP.getSrcReg()); in joinReservedPhysReg()
1722 const CoalescerPair &CP; member in __anona927d7ac0211::JoinVals
1869 NewVNInfo(newVNInfo), CP(cp), LIS(lis), Indexes(LIS->getSlotIndexes()), in JoinVals()
2129 if (CP.isCoalescable(DefMI)) { in analyzeValue()
2146 if (DefMI->isFullCopy() && !CP.isPartial() in analyzeValue()
2529 Reg != CP.getSrcReg() && Reg != CP.getDstReg()) in eraseInstrs()
2546 const CoalescerPair &CP) { in joinSubRegRanges() argument
2548 JoinVals RHSVals(RRange, CP.getSrcReg(), CP.getSrcIdx(), LaneMask, in joinSubRegRanges()
2549 NewVNInfo, CP, LIS, TRI, true, true); in joinSubRegRanges()
2550 JoinVals LHSVals(LRange, CP.getDstReg(), CP.getDstIdx(), LaneMask, in joinSubRegRanges()
2551 NewVNInfo, CP, LIS, TRI, true, true); in joinSubRegRanges()
2602 CoalescerPair &CP) { in mergeSubRangeInto() argument
2629 joinSubRegRanges(*CommonRange, RangeCopy, Common, CP); in mergeSubRangeInto()
2639 bool RegisterCoalescer::joinVirtRegs(CoalescerPair &CP) { in joinVirtRegs() argument
2641 LiveInterval &RHS = LIS->getInterval(CP.getSrcReg()); in joinVirtRegs()
2642 LiveInterval &LHS = LIS->getInterval(CP.getDstReg()); in joinVirtRegs()
2643 bool TrackSubRegLiveness = MRI->shouldTrackSubRegLiveness(*CP.getNewRC()); in joinVirtRegs()
2644 JoinVals RHSVals(RHS, CP.getSrcReg(), CP.getSrcIdx(), 0, NewVNInfo, CP, LIS, in joinVirtRegs()
2646 JoinVals LHSVals(LHS, CP.getDstReg(), CP.getDstIdx(), 0, NewVNInfo, CP, LIS, in joinVirtRegs()
2668 unsigned DstIdx = CP.getDstIdx(); in joinVirtRegs()
2670 LaneBitmask Mask = DstIdx == 0 ? CP.getNewRC()->getLaneMask() in joinVirtRegs()
2682 DEBUG(dbgs() << "\t\tLHST = " << PrintReg(CP.getDstReg()) in joinVirtRegs()
2686 unsigned SrcIdx = CP.getSrcIdx(); in joinVirtRegs()
2688 LaneBitmask Mask = SrcIdx == 0 ? CP.getNewRC()->getLaneMask() in joinVirtRegs()
2690 mergeSubRangeInto(LHS, RHS, Mask, CP); in joinVirtRegs()
2695 mergeSubRangeInto(LHS, R, Mask, CP); in joinVirtRegs()
2740 bool RegisterCoalescer::joinIntervals(CoalescerPair &CP) { in joinIntervals() argument
2741 return CP.isPhys() ? joinReservedPhysReg(CP) : joinVirtRegs(CP); in joinIntervals()