aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakob Stoklund Olesen <stoklund@2pi.dk>2010-05-14 22:40:40 +0000
committerJakob Stoklund Olesen <stoklund@2pi.dk>2010-05-14 22:40:40 +0000
commitab2d00863f105b671b5f0da60152e14f13e0a4b3 (patch)
tree63541c203ebacda6e5f3df70124f198166408e81
parent23ead992838188a3696a0c4510010b41824e789e (diff)
RegAllocLocal can count copies too
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103830 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/CodeGen/RegAllocLocal.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/CodeGen/RegAllocLocal.cpp b/lib/CodeGen/RegAllocLocal.cpp
index 6372559824..8106a36c9b 100644
--- a/lib/CodeGen/RegAllocLocal.cpp
+++ b/lib/CodeGen/RegAllocLocal.cpp
@@ -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();