RegAllocLocal can count copies too

llvm-svn: 103830
This commit is contained in:
Jakob Stoklund Olesen 2010-05-14 22:40:40 +00:00
parent 5fde821884
commit ed0d357e27

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();