Lines Matching refs:CP
142 bool joinIntervals(CoalescerPair &CP);
145 bool joinVirtRegs(CoalescerPair &CP);
148 bool joinReservedPhysReg(CoalescerPair &CP);
154 bool adjustCopiesBackFrom(const CoalescerPair &CP, MachineInstr *CopyMI);
165 bool removeCopyByCommutingDef(const CoalescerPair &CP,MachineInstr *CopyMI);
169 bool reMaterializeTrivialDef(CoalescerPair &CP, MachineInstr *CopyMI);
172 bool canJoinPhys(const CoalescerPair &CP);
182 bool eliminateUndefCopy(MachineInstr *CopyMI, const CoalescerPair &CP);
425 bool RegisterCoalescer::adjustCopiesBackFrom(const CoalescerPair &CP, in adjustCopiesBackFrom() argument
427 assert(!CP.isPartial() && "This doesn't work for partial copies."); in adjustCopiesBackFrom()
428 assert(!CP.isPhys() && "This doesn't work for physreg copies."); in adjustCopiesBackFrom()
431 LIS->getInterval(CP.isFlipped() ? CP.getDstReg() : CP.getSrcReg()); in adjustCopiesBackFrom()
433 LIS->getInterval(CP.isFlipped() ? CP.getSrcReg() : CP.getDstReg()); in adjustCopiesBackFrom()
458 if (!CP.isCoalescable(ACopyMI) || !ACopyMI->isFullCopy()) in adjustCopiesBackFrom()
568 bool RegisterCoalescer::removeCopyByCommutingDef(const CoalescerPair &CP, in removeCopyByCommutingDef() argument
570 assert (!CP.isPhys()); in removeCopyByCommutingDef()
575 LIS->getInterval(CP.isFlipped() ? CP.getDstReg() : CP.getSrcReg()); in removeCopyByCommutingDef()
577 LIS->getInterval(CP.isFlipped() ? CP.getSrcReg() : CP.getDstReg()); in removeCopyByCommutingDef()
733 bool RegisterCoalescer::reMaterializeTrivialDef(CoalescerPair &CP, in reMaterializeTrivialDef() argument
735 unsigned SrcReg = CP.isFlipped() ? CP.getDstReg() : CP.getSrcReg(); in reMaterializeTrivialDef()
736 unsigned DstReg = CP.isFlipped() ? CP.getSrcReg() : CP.getDstReg(); in reMaterializeTrivialDef()
848 const CoalescerPair &CP) { in eliminateUndefCopy() argument
850 LiveInterval *SrcInt = &LIS->getInterval(CP.getSrcReg()); in eliminateUndefCopy()
853 LiveInterval *DstInt = &LIS->getInterval(CP.getDstReg()); in eliminateUndefCopy()
858 if (CP.isFlipped()) in eliminateUndefCopy()
940 bool RegisterCoalescer::canJoinPhys(const CoalescerPair &CP) { in canJoinPhys() argument
944 if (!MRI->isReserved(CP.getDstReg())) { in canJoinPhys()
949 LiveInterval &JoinVInt = LIS->getInterval(CP.getSrcReg()); in canJoinPhys()
950 if (CP.isFlipped() && JoinVInt.containsOneValue()) in canJoinPhys()
967 CoalescerPair CP(*TRI); in joinCopy() local
968 if (!CP.setRegisters(CopyMI)) { in joinCopy()
976 if (!CP.isPhys() && CopyMI->allDefsAreDead()) { in joinCopy()
984 if (!CP.isPhys() && eliminateUndefCopy(CopyMI, CP)) { in joinCopy()
994 if (CP.getSrcReg() == CP.getDstReg()) { in joinCopy()
995 LiveInterval &LI = LIS->getInterval(CP.getSrcReg()); in joinCopy()
1011 if (CP.isPhys()) { in joinCopy()
1012 DEBUG(dbgs() << "\tConsidering merging " << PrintReg(CP.getSrcReg(), TRI) in joinCopy()
1013 << " with " << PrintReg(CP.getDstReg(), TRI, CP.getSrcIdx()) in joinCopy()
1015 if (!canJoinPhys(CP)) { in joinCopy()
1018 if (reMaterializeTrivialDef(CP, CopyMI)) in joinCopy()
1024 dbgs() << "\tConsidering merging to " << CP.getNewRC()->getName() in joinCopy()
1026 if (CP.getDstIdx() && CP.getSrcIdx()) in joinCopy()
1027 dbgs() << PrintReg(CP.getDstReg()) << " in " in joinCopy()
1028 << TRI->getSubRegIndexName(CP.getDstIdx()) << " and " in joinCopy()
1029 << PrintReg(CP.getSrcReg()) << " in " in joinCopy()
1030 << TRI->getSubRegIndexName(CP.getSrcIdx()) << '\n'; in joinCopy()
1032 dbgs() << PrintReg(CP.getSrcReg(), TRI) << " in " in joinCopy()
1033 << PrintReg(CP.getDstReg(), TRI, CP.getSrcIdx()) << '\n'; in joinCopy()
1037 if (!CP.isPartial() && LIS->getInterval(CP.getSrcReg()).ranges.size() > in joinCopy()
1038 LIS->getInterval(CP.getDstReg()).ranges.size()) in joinCopy()
1039 CP.flip(); in joinCopy()
1046 if (!joinIntervals(CP)) { in joinCopy()
1051 if (reMaterializeTrivialDef(CP, CopyMI)) in joinCopy()
1055 if (!CP.isPartial() && !CP.isPhys()) { in joinCopy()
1056 if (adjustCopiesBackFrom(CP, CopyMI) || in joinCopy()
1057 removeCopyByCommutingDef(CP, CopyMI)) { in joinCopy()
1073 if (CP.isCrossClass()) { in joinCopy()
1075 MRI->setRegClass(CP.getDstReg(), CP.getNewRC()); in joinCopy()
1080 if (!CP.isPhys() && RegClassInfo.isProperSubClass(CP.getNewRC())) in joinCopy()
1081 InflateRegs.push_back(CP.getDstReg()); in joinCopy()
1090 if (CP.getDstIdx()) in joinCopy()
1091 updateRegDefsUses(CP.getDstReg(), CP.getDstReg(), CP.getDstIdx()); in joinCopy()
1092 updateRegDefsUses(CP.getSrcReg(), CP.getDstReg(), CP.getSrcIdx()); in joinCopy()
1096 LIS->removeInterval(CP.getSrcReg()); in joinCopy()
1099 TRI->UpdateRegAllocHint(CP.getSrcReg(), CP.getDstReg(), *MF); in joinCopy()
1102 dbgs() << "\tJoined. Result = " << PrintReg(CP.getDstReg(), TRI); in joinCopy()
1103 if (!CP.isPhys()) in joinCopy()
1104 dbgs() << LIS->getInterval(CP.getDstReg()); in joinCopy()
1113 bool RegisterCoalescer::joinReservedPhysReg(CoalescerPair &CP) { in joinReservedPhysReg() argument
1114 assert(CP.isPhys() && "Must be a physreg copy"); in joinReservedPhysReg()
1115 assert(MRI->isReserved(CP.getDstReg()) && "Not a reserved register"); in joinReservedPhysReg()
1116 LiveInterval &RHS = LIS->getInterval(CP.getSrcReg()); in joinReservedPhysReg()
1117 DEBUG(dbgs() << "\t\tRHS = " << PrintReg(CP.getSrcReg()) << ' ' << RHS in joinReservedPhysReg()
1120 assert(CP.isFlipped() && RHS.containsOneValue() && in joinReservedPhysReg()
1130 for (MCRegUnitIterator UI(CP.getDstReg(), TRI); UI.isValid(); ++UI) in joinReservedPhysReg()
1147 MRI->clearKillFlags(CP.getSrcReg()); in joinReservedPhysReg()
1230 const CoalescerPair &CP; member in __anoneed1b2d20211::JoinVals
1331 : LI(li), SubIdx(subIdx), NewVNInfo(newVNInfo), CP(cp), LIS(lis), in JoinVals()
1530 if (CP.isCoalescable(DefMI)) { in analyzeValue()
1547 if (DefMI->isFullCopy() && !CP.isPartial() && in analyzeValue()
1892 Reg != CP.getSrcReg() && Reg != CP.getDstReg()) in eraseInstrs()
1907 bool RegisterCoalescer::joinVirtRegs(CoalescerPair &CP) { in joinVirtRegs() argument
1909 LiveInterval &RHS = LIS->getInterval(CP.getSrcReg()); in joinVirtRegs()
1910 LiveInterval &LHS = LIS->getInterval(CP.getDstReg()); in joinVirtRegs()
1911 JoinVals RHSVals(RHS, CP.getSrcIdx(), NewVNInfo, CP, LIS, TRI); in joinVirtRegs()
1912 JoinVals LHSVals(LHS, CP.getDstIdx(), NewVNInfo, CP, LIS, TRI); in joinVirtRegs()
1914 DEBUG(dbgs() << "\t\tRHS = " << PrintReg(CP.getSrcReg()) << ' ' << RHS in joinVirtRegs()
1915 << "\n\t\tLHS = " << PrintReg(CP.getDstReg()) << ' ' << LHS in joinVirtRegs()
1968 bool RegisterCoalescer::joinIntervals(CoalescerPair &CP) { in joinIntervals() argument
1969 return CP.isPhys() ? joinReservedPhysReg(CP) : joinVirtRegs(CP); in joinIntervals()