RegAllocLocal can count copies too

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103830 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Jakob Stoklund Olesen 2010-05-14 22:40:40 +00:00
parent 23ead99283
commit ab2d00863f

View File

@ -37,6 +37,7 @@ using namespace llvm;
STATISTIC(NumStores, "Number of stores added");
STATISTIC(NumLoads , "Number of loads added");
STATISTIC(NumCopies, "Number of copies coalesced");
static RegisterRegAlloc
localRegAlloc("local", "local register allocator",
@ -1156,8 +1157,10 @@ void RALocal::AllocateBasicBlock(MachineBasicBlock &MBB) {
if (TII->isMoveInstr(*MI, SrcCopyReg, DstCopyReg,
SrcCopySubReg, DstCopySubReg) &&
SrcCopyReg == DstCopyReg && SrcCopySubReg == DstCopySubReg &&
DeadDefs.empty())
DeadDefs.empty()) {
++NumCopies;
MBB.erase(MI);
}
}
MachineBasicBlock::iterator MI = MBB.getFirstTerminator();