Lines Matching refs:CP
154 bool joinIntervals(CoalescerPair &CP);
157 bool joinVirtRegs(CoalescerPair &CP);
160 bool joinReservedPhysReg(CoalescerPair &CP);
169 unsigned LaneMask, CoalescerPair &CP);
175 unsigned LaneMask, const CoalescerPair &CP);
181 bool adjustCopiesBackFrom(const CoalescerPair &CP, MachineInstr *CopyMI);
193 bool removeCopyByCommutingDef(const CoalescerPair &CP,MachineInstr *CopyMI);
197 bool reMaterializeTrivialDef(CoalescerPair &CP, MachineInstr *CopyMI,
201 bool canJoinPhys(const CoalescerPair &CP);
451 bool RegisterCoalescer::adjustCopiesBackFrom(const CoalescerPair &CP, in adjustCopiesBackFrom() argument
453 assert(!CP.isPartial() && "This doesn't work for partial copies."); in adjustCopiesBackFrom()
454 assert(!CP.isPhys() && "This doesn't work for physreg copies."); in adjustCopiesBackFrom()
457 LIS->getInterval(CP.isFlipped() ? CP.getDstReg() : CP.getSrcReg()); in adjustCopiesBackFrom()
459 LIS->getInterval(CP.isFlipped() ? CP.getSrcReg() : CP.getDstReg()); in adjustCopiesBackFrom()
498 if (!CP.isCoalescable(ACopyMI) || !ACopyMI->isFullCopy()) in adjustCopiesBackFrom()
604 bool RegisterCoalescer::removeCopyByCommutingDef(const CoalescerPair &CP, in removeCopyByCommutingDef() argument
606 assert(!CP.isPhys()); in removeCopyByCommutingDef()
609 LIS->getInterval(CP.isFlipped() ? CP.getDstReg() : CP.getSrcReg()); in removeCopyByCommutingDef()
611 LIS->getInterval(CP.isFlipped() ? CP.getSrcReg() : CP.getDstReg()); in removeCopyByCommutingDef()
854 bool RegisterCoalescer::reMaterializeTrivialDef(CoalescerPair &CP, in reMaterializeTrivialDef() argument
858 unsigned SrcReg = CP.isFlipped() ? CP.getDstReg() : CP.getSrcReg(); in reMaterializeTrivialDef()
859 unsigned SrcIdx = CP.isFlipped() ? CP.getDstIdx() : CP.getSrcIdx(); in reMaterializeTrivialDef()
860 unsigned DstReg = CP.isFlipped() ? CP.getSrcReg() : CP.getDstReg(); in reMaterializeTrivialDef()
861 unsigned DstIdx = CP.isFlipped() ? CP.getSrcIdx() : CP.getDstIdx(); in reMaterializeTrivialDef()
909 unsigned NewDstIdx = TRI->composeSubRegIndices(CP.getSrcIdx(), in reMaterializeTrivialDef()
951 const TargetRegisterClass *NewRC = CP.getNewRC(); in reMaterializeTrivialDef()
1213 bool RegisterCoalescer::canJoinPhys(const CoalescerPair &CP) { in canJoinPhys() argument
1217 if (!MRI->isReserved(CP.getDstReg())) { in canJoinPhys()
1222 LiveInterval &JoinVInt = LIS->getInterval(CP.getSrcReg()); in canJoinPhys()
1235 CoalescerPair CP(*TRI); in joinCopy() local
1236 if (!CP.setRegisters(CopyMI)) { in joinCopy()
1241 if (CP.getNewRC()) { in joinCopy()
1242 auto SrcRC = MRI->getRegClass(CP.getSrcReg()); in joinCopy()
1243 auto DstRC = MRI->getRegClass(CP.getDstReg()); in joinCopy()
1244 unsigned SrcIdx = CP.getSrcIdx(); in joinCopy()
1245 unsigned DstIdx = CP.getDstIdx(); in joinCopy()
1246 if (CP.isFlipped()) { in joinCopy()
1251 CP.getNewRC())) { in joinCopy()
1260 if (!CP.isPhys() && CopyMI->allDefsAreDead()) { in joinCopy()
1268 if (!CP.isPhys() && eliminateUndefCopy(CopyMI)) { in joinCopy()
1277 if (CP.getSrcReg() == CP.getDstReg()) { in joinCopy()
1278 LiveInterval &LI = LIS->getInterval(CP.getSrcReg()); in joinCopy()
1304 if (CP.isPhys()) { in joinCopy()
1305 DEBUG(dbgs() << "\tConsidering merging " << PrintReg(CP.getSrcReg(), TRI) in joinCopy()
1306 << " with " << PrintReg(CP.getDstReg(), TRI, CP.getSrcIdx()) in joinCopy()
1308 if (!canJoinPhys(CP)) { in joinCopy()
1312 if (reMaterializeTrivialDef(CP, CopyMI, IsDefCopy)) in joinCopy()
1320 if (!CP.isPartial() && LIS->getInterval(CP.getSrcReg()).size() > in joinCopy()
1321 LIS->getInterval(CP.getDstReg()).size()) in joinCopy()
1322 CP.flip(); in joinCopy()
1326 << TRI->getRegClassName(CP.getNewRC()) << " with "; in joinCopy()
1327 if (CP.getDstIdx() && CP.getSrcIdx()) in joinCopy()
1328 dbgs() << PrintReg(CP.getDstReg()) << " in " in joinCopy()
1329 << TRI->getSubRegIndexName(CP.getDstIdx()) << " and " in joinCopy()
1330 << PrintReg(CP.getSrcReg()) << " in " in joinCopy()
1331 << TRI->getSubRegIndexName(CP.getSrcIdx()) << '\n'; in joinCopy()
1333 dbgs() << PrintReg(CP.getSrcReg(), TRI) << " in " in joinCopy()
1334 << PrintReg(CP.getDstReg(), TRI, CP.getSrcIdx()) << '\n'; in joinCopy()
1345 if (!joinIntervals(CP)) { in joinCopy()
1351 if (reMaterializeTrivialDef(CP, CopyMI, IsDefCopy)) in joinCopy()
1356 if (!CP.isPartial() && !CP.isPhys()) { in joinCopy()
1357 if (adjustCopiesBackFrom(CP, CopyMI) || in joinCopy()
1358 removeCopyByCommutingDef(CP, CopyMI)) { in joinCopy()
1374 if (CP.isCrossClass()) { in joinCopy()
1376 MRI->setRegClass(CP.getDstReg(), CP.getNewRC()); in joinCopy()
1381 if (!CP.isPhys() && RegClassInfo.isProperSubClass(CP.getNewRC())) in joinCopy()
1382 InflateRegs.push_back(CP.getDstReg()); in joinCopy()
1391 if (CP.getDstIdx()) in joinCopy()
1392 updateRegDefsUses(CP.getDstReg(), CP.getDstReg(), CP.getDstIdx()); in joinCopy()
1393 updateRegDefsUses(CP.getSrcReg(), CP.getDstReg(), CP.getSrcIdx()); in joinCopy()
1397 LiveInterval &LI = LIS->getInterval(CP.getDstReg()); in joinCopy()
1407 LiveInterval &LI = LIS->getInterval(CP.getDstReg()); in joinCopy()
1413 LIS->removeInterval(CP.getSrcReg()); in joinCopy()
1416 TRI->updateRegAllocHint(CP.getSrcReg(), CP.getDstReg(), *MF); in joinCopy()
1419 dbgs() << "\tSuccess: " << PrintReg(CP.getSrcReg(), TRI, CP.getSrcIdx()) in joinCopy()
1420 << " -> " << PrintReg(CP.getDstReg(), TRI, CP.getDstIdx()) << '\n'; in joinCopy()
1422 if (CP.isPhys()) in joinCopy()
1423 dbgs() << PrintReg(CP.getDstReg(), TRI); in joinCopy()
1425 dbgs() << LIS->getInterval(CP.getDstReg()); in joinCopy()
1433 bool RegisterCoalescer::joinReservedPhysReg(CoalescerPair &CP) { in joinReservedPhysReg() argument
1434 unsigned DstReg = CP.getDstReg(); in joinReservedPhysReg()
1435 assert(CP.isPhys() && "Must be a physreg copy"); in joinReservedPhysReg()
1437 LiveInterval &RHS = LIS->getInterval(CP.getSrcReg()); in joinReservedPhysReg()
1462 if (CP.isFlipped()) { in joinReservedPhysReg()
1505 MRI->clearKillFlags(CP.getSrcReg()); in joinReservedPhysReg()
1602 const CoalescerPair &CP; member in __anona927d7ac0211::JoinVals
1749 NewVNInfo(newVNInfo), CP(cp), LIS(lis), Indexes(LIS->getSlotIndexes()), in JoinVals()
2009 if (CP.isCoalescable(DefMI)) { in analyzeValue()
2026 if (DefMI->isFullCopy() && !CP.isPartial() in analyzeValue()
2409 Reg != CP.getSrcReg() && Reg != CP.getDstReg()) in eraseInstrs()
2426 const CoalescerPair &CP) { in joinSubRegRanges() argument
2428 JoinVals RHSVals(RRange, CP.getSrcReg(), CP.getSrcIdx(), LaneMask, in joinSubRegRanges()
2429 NewVNInfo, CP, LIS, TRI, true, true); in joinSubRegRanges()
2430 JoinVals LHSVals(LRange, CP.getDstReg(), CP.getDstIdx(), LaneMask, in joinSubRegRanges()
2431 NewVNInfo, CP, LIS, TRI, true, true); in joinSubRegRanges()
2480 unsigned LaneMask, CoalescerPair &CP) { in mergeSubRangeInto() argument
2506 if (!joinSubRegRanges(*CommonRange, RangeCopy, Common, CP)) in mergeSubRangeInto()
2518 bool RegisterCoalescer::joinVirtRegs(CoalescerPair &CP) { in joinVirtRegs() argument
2520 LiveInterval &RHS = LIS->getInterval(CP.getSrcReg()); in joinVirtRegs()
2521 LiveInterval &LHS = LIS->getInterval(CP.getDstReg()); in joinVirtRegs()
2522 bool TrackSubRegLiveness = MRI->shouldTrackSubRegLiveness(*CP.getNewRC()); in joinVirtRegs()
2523 JoinVals RHSVals(RHS, CP.getSrcReg(), CP.getSrcIdx(), 0, NewVNInfo, CP, LIS, in joinVirtRegs()
2525 JoinVals LHSVals(LHS, CP.getDstReg(), CP.getDstIdx(), 0, NewVNInfo, CP, LIS, in joinVirtRegs()
2547 unsigned DstIdx = CP.getDstIdx(); in joinVirtRegs()
2549 unsigned Mask = DstIdx == 0 ? CP.getNewRC()->getLaneMask() in joinVirtRegs()
2561 DEBUG(dbgs() << "\t\tLHST = " << PrintReg(CP.getDstReg()) in joinVirtRegs()
2565 unsigned SrcIdx = CP.getSrcIdx(); in joinVirtRegs()
2568 unsigned Mask = SrcIdx == 0 ? CP.getNewRC()->getLaneMask() in joinVirtRegs()
2570 if (!mergeSubRangeInto(LHS, RHS, Mask, CP)) in joinVirtRegs()
2576 if (!mergeSubRangeInto(LHS, R, Mask, CP)) { in joinVirtRegs()
2589 assert((CP.getNewRC()->getLaneMask() & 0x80000000u) in joinVirtRegs()
2638 bool RegisterCoalescer::joinIntervals(CoalescerPair &CP) { in joinIntervals() argument
2639 return CP.isPhys() ? joinReservedPhysReg(CP) : joinVirtRegs(CP); in joinIntervals()