summaryrefslogtreecommitdiff
path: root/lib/CodeGen/PrologEpilogInserter.cpp
diff options
context:
space:
mode:
authorJim Grosbach <grosbach@apple.com>2010-08-25 20:34:28 +0000
committerJim Grosbach <grosbach@apple.com>2010-08-25 20:34:28 +0000
commitc52b3cced8aebbc665021ec6b8bcd0974c4ad7ae (patch)
treed2bd05b3fa3d99582dc038af0f82fff9a8d44a7c /lib/CodeGen/PrologEpilogInserter.cpp
parent064ff3e4356584b793b4738f02b9fa6b1d863d76 (diff)
downloadllvm-c52b3cced8aebbc665021ec6b8bcd0974c4ad7ae.tar.gz
llvm-c52b3cced8aebbc665021ec6b8bcd0974c4ad7ae.tar.bz2
llvm-c52b3cced8aebbc665021ec6b8bcd0974c4ad7ae.tar.xz
Add some statistics for PEI register scavenging
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112084 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/PrologEpilogInserter.cpp')
-rw-r--r--lib/CodeGen/PrologEpilogInserter.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/CodeGen/PrologEpilogInserter.cpp b/lib/CodeGen/PrologEpilogInserter.cpp
index 4c3e796f5e..734bf63252 100644
--- a/lib/CodeGen/PrologEpilogInserter.cpp
+++ b/lib/CodeGen/PrologEpilogInserter.cpp
@@ -36,6 +36,7 @@
#include "llvm/Support/Debug.h"
#include "llvm/ADT/IndexedMap.h"
#include "llvm/ADT/SmallSet.h"
+#include "llvm/ADT/Statistic.h"
#include "llvm/ADT/STLExtras.h"
#include <climits>
@@ -46,6 +47,9 @@ char PEI::ID = 0;
INITIALIZE_PASS(PEI, "prologepilog",
"Prologue/Epilogue Insertion", false, false);
+STATISTIC(NumVirtualFrameRegs, "Number of virtual frame regs encountered");
+STATISTIC(NumScavengedRegs, "Number of frame index regs scavenged");
+
/// createPrologEpilogCodeInserter - This function returns a pass that inserts
/// prolog and epilog code, and eliminates abstract frame references.
///
@@ -873,6 +877,8 @@ void PEI::scavengeFrameVirtualRegs(MachineFunction &Fn) {
}
continue;
}
+ ++NumVirtualFrameRegs;
+
// If this is a def, remember that this insn defines the value.
// This lets us properly consider insns which re-use the scratch
// register, such as r2 = sub r2, #imm, in the middle of the
@@ -945,6 +951,7 @@ void PEI::scavengeFrameVirtualRegs(MachineFunction &Fn) {
const TargetRegisterClass *RC = Fn.getRegInfo().getRegClass(Reg);
CurrentScratchReg = RS->scavengeRegister(RC, I, SPAdj);
PrevValue = Value;
+ ++NumScavengedRegs;
}
// replace this reference to the virtual register with the
// scratch register.