mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-09 10:31:14 +00:00
Remove unnecessary wrapper.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133886 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
0b19acbb8f
commit
79db6a1db6
@ -839,8 +839,7 @@ SimpleRegisterCoalescing::isWinToJoinCrossClass(unsigned SrcReg,
|
|||||||
/// if the copy was successfully coalesced away. If it is not currently
|
/// if the copy was successfully coalesced away. If it is not currently
|
||||||
/// possible to coalesce this interval, but it may be possible if other
|
/// possible to coalesce this interval, but it may be possible if other
|
||||||
/// things get coalesced, then it returns true by reference in 'Again'.
|
/// things get coalesced, then it returns true by reference in 'Again'.
|
||||||
bool SimpleRegisterCoalescing::JoinCopy(CopyRec &TheCopy, bool &Again) {
|
bool SimpleRegisterCoalescing::JoinCopy(MachineInstr *CopyMI, bool &Again) {
|
||||||
MachineInstr *CopyMI = TheCopy.MI;
|
|
||||||
|
|
||||||
Again = false;
|
Again = false;
|
||||||
if (JoinedCopies.count(CopyMI) || ReMatCopies.count(CopyMI))
|
if (JoinedCopies.count(CopyMI) || ReMatCopies.count(CopyMI))
|
||||||
@ -1268,12 +1267,12 @@ namespace {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void SimpleRegisterCoalescing::CopyCoalesceInMBB(MachineBasicBlock *MBB,
|
void SimpleRegisterCoalescing::CopyCoalesceInMBB(MachineBasicBlock *MBB,
|
||||||
std::vector<CopyRec> &TryAgain) {
|
std::vector<MachineInstr*> &TryAgain) {
|
||||||
DEBUG(dbgs() << MBB->getName() << ":\n");
|
DEBUG(dbgs() << MBB->getName() << ":\n");
|
||||||
|
|
||||||
SmallVector<CopyRec, 8> VirtCopies;
|
SmallVector<MachineInstr*, 8> VirtCopies;
|
||||||
SmallVector<CopyRec, 8> PhysCopies;
|
SmallVector<MachineInstr*, 8> PhysCopies;
|
||||||
SmallVector<CopyRec, 8> ImpDefCopies;
|
SmallVector<MachineInstr*, 8> ImpDefCopies;
|
||||||
for (MachineBasicBlock::iterator MII = MBB->begin(), E = MBB->end();
|
for (MachineBasicBlock::iterator MII = MBB->begin(), E = MBB->end();
|
||||||
MII != E;) {
|
MII != E;) {
|
||||||
MachineInstr *Inst = MII++;
|
MachineInstr *Inst = MII++;
|
||||||
@ -1292,32 +1291,32 @@ void SimpleRegisterCoalescing::CopyCoalesceInMBB(MachineBasicBlock *MBB,
|
|||||||
bool SrcIsPhys = TargetRegisterInfo::isPhysicalRegister(SrcReg);
|
bool SrcIsPhys = TargetRegisterInfo::isPhysicalRegister(SrcReg);
|
||||||
bool DstIsPhys = TargetRegisterInfo::isPhysicalRegister(DstReg);
|
bool DstIsPhys = TargetRegisterInfo::isPhysicalRegister(DstReg);
|
||||||
if (li_->hasInterval(SrcReg) && li_->getInterval(SrcReg).empty())
|
if (li_->hasInterval(SrcReg) && li_->getInterval(SrcReg).empty())
|
||||||
ImpDefCopies.push_back(CopyRec(Inst, 0));
|
ImpDefCopies.push_back(Inst);
|
||||||
else if (SrcIsPhys || DstIsPhys)
|
else if (SrcIsPhys || DstIsPhys)
|
||||||
PhysCopies.push_back(CopyRec(Inst, 0));
|
PhysCopies.push_back(Inst);
|
||||||
else
|
else
|
||||||
VirtCopies.push_back(CopyRec(Inst, 0));
|
VirtCopies.push_back(Inst);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Try coalescing implicit copies and insert_subreg <undef> first,
|
// Try coalescing implicit copies and insert_subreg <undef> first,
|
||||||
// followed by copies to / from physical registers, then finally copies
|
// followed by copies to / from physical registers, then finally copies
|
||||||
// from virtual registers to virtual registers.
|
// from virtual registers to virtual registers.
|
||||||
for (unsigned i = 0, e = ImpDefCopies.size(); i != e; ++i) {
|
for (unsigned i = 0, e = ImpDefCopies.size(); i != e; ++i) {
|
||||||
CopyRec &TheCopy = ImpDefCopies[i];
|
MachineInstr *TheCopy = ImpDefCopies[i];
|
||||||
bool Again = false;
|
bool Again = false;
|
||||||
if (!JoinCopy(TheCopy, Again))
|
if (!JoinCopy(TheCopy, Again))
|
||||||
if (Again)
|
if (Again)
|
||||||
TryAgain.push_back(TheCopy);
|
TryAgain.push_back(TheCopy);
|
||||||
}
|
}
|
||||||
for (unsigned i = 0, e = PhysCopies.size(); i != e; ++i) {
|
for (unsigned i = 0, e = PhysCopies.size(); i != e; ++i) {
|
||||||
CopyRec &TheCopy = PhysCopies[i];
|
MachineInstr *TheCopy = PhysCopies[i];
|
||||||
bool Again = false;
|
bool Again = false;
|
||||||
if (!JoinCopy(TheCopy, Again))
|
if (!JoinCopy(TheCopy, Again))
|
||||||
if (Again)
|
if (Again)
|
||||||
TryAgain.push_back(TheCopy);
|
TryAgain.push_back(TheCopy);
|
||||||
}
|
}
|
||||||
for (unsigned i = 0, e = VirtCopies.size(); i != e; ++i) {
|
for (unsigned i = 0, e = VirtCopies.size(); i != e; ++i) {
|
||||||
CopyRec &TheCopy = VirtCopies[i];
|
MachineInstr *TheCopy = VirtCopies[i];
|
||||||
bool Again = false;
|
bool Again = false;
|
||||||
if (!JoinCopy(TheCopy, Again))
|
if (!JoinCopy(TheCopy, Again))
|
||||||
if (Again)
|
if (Again)
|
||||||
@ -1328,7 +1327,7 @@ void SimpleRegisterCoalescing::CopyCoalesceInMBB(MachineBasicBlock *MBB,
|
|||||||
void SimpleRegisterCoalescing::joinIntervals() {
|
void SimpleRegisterCoalescing::joinIntervals() {
|
||||||
DEBUG(dbgs() << "********** JOINING INTERVALS ***********\n");
|
DEBUG(dbgs() << "********** JOINING INTERVALS ***********\n");
|
||||||
|
|
||||||
std::vector<CopyRec> TryAgainList;
|
std::vector<MachineInstr*> TryAgainList;
|
||||||
if (loopInfo->empty()) {
|
if (loopInfo->empty()) {
|
||||||
// If there are no loops in the function, join intervals in function order.
|
// If there are no loops in the function, join intervals in function order.
|
||||||
for (MachineFunction::iterator I = mf_->begin(), E = mf_->end();
|
for (MachineFunction::iterator I = mf_->begin(), E = mf_->end();
|
||||||
@ -1362,14 +1361,14 @@ void SimpleRegisterCoalescing::joinIntervals() {
|
|||||||
ProgressMade = false;
|
ProgressMade = false;
|
||||||
|
|
||||||
for (unsigned i = 0, e = TryAgainList.size(); i != e; ++i) {
|
for (unsigned i = 0, e = TryAgainList.size(); i != e; ++i) {
|
||||||
CopyRec &TheCopy = TryAgainList[i];
|
MachineInstr *&TheCopy = TryAgainList[i];
|
||||||
if (!TheCopy.MI)
|
if (!TheCopy)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
bool Again = false;
|
bool Again = false;
|
||||||
bool Success = JoinCopy(TheCopy, Again);
|
bool Success = JoinCopy(TheCopy, Again);
|
||||||
if (Success || !Again) {
|
if (Success || !Again) {
|
||||||
TheCopy.MI = 0; // Mark this one as done.
|
TheCopy= 0; // Mark this one as done.
|
||||||
ProgressMade = true;
|
ProgressMade = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -27,15 +27,6 @@ namespace llvm {
|
|||||||
class VirtRegMap;
|
class VirtRegMap;
|
||||||
class MachineLoopInfo;
|
class MachineLoopInfo;
|
||||||
|
|
||||||
/// CopyRec - Representation for copy instructions in coalescer queue.
|
|
||||||
///
|
|
||||||
struct CopyRec {
|
|
||||||
MachineInstr *MI;
|
|
||||||
unsigned LoopDepth;
|
|
||||||
CopyRec(MachineInstr *mi, unsigned depth)
|
|
||||||
: MI(mi), LoopDepth(depth) {}
|
|
||||||
};
|
|
||||||
|
|
||||||
class SimpleRegisterCoalescing : public MachineFunctionPass,
|
class SimpleRegisterCoalescing : public MachineFunctionPass,
|
||||||
public RegisterCoalescer {
|
public RegisterCoalescer {
|
||||||
MachineFunction* mf_;
|
MachineFunction* mf_;
|
||||||
@ -88,14 +79,14 @@ namespace llvm {
|
|||||||
/// CopyCoalesceInMBB - Coalesce copies in the specified MBB, putting
|
/// CopyCoalesceInMBB - Coalesce copies in the specified MBB, putting
|
||||||
/// copies that cannot yet be coalesced into the "TryAgain" list.
|
/// copies that cannot yet be coalesced into the "TryAgain" list.
|
||||||
void CopyCoalesceInMBB(MachineBasicBlock *MBB,
|
void CopyCoalesceInMBB(MachineBasicBlock *MBB,
|
||||||
std::vector<CopyRec> &TryAgain);
|
std::vector<MachineInstr*> &TryAgain);
|
||||||
|
|
||||||
/// JoinCopy - Attempt to join intervals corresponding to SrcReg/DstReg,
|
/// JoinCopy - Attempt to join intervals corresponding to SrcReg/DstReg,
|
||||||
/// which are the src/dst of the copy instruction CopyMI. This returns true
|
/// which are the src/dst of the copy instruction CopyMI. This returns true
|
||||||
/// if the copy was successfully coalesced away. If it is not currently
|
/// if the copy was successfully coalesced away. If it is not currently
|
||||||
/// possible to coalesce this interval, but it may be possible if other
|
/// possible to coalesce this interval, but it may be possible if other
|
||||||
/// things get coalesced, then it returns true by reference in 'Again'.
|
/// things get coalesced, then it returns true by reference in 'Again'.
|
||||||
bool JoinCopy(CopyRec &TheCopy, bool &Again);
|
bool JoinCopy(MachineInstr *TheCopy, bool &Again);
|
||||||
|
|
||||||
/// JoinIntervals - Attempt to join these two intervals. On failure, this
|
/// JoinIntervals - Attempt to join these two intervals. On failure, this
|
||||||
/// returns false. The output "SrcInt" will not have been modified, so we can
|
/// returns false. The output "SrcInt" will not have been modified, so we can
|
||||||
|
Loading…
Reference in New Issue
Block a user