[llvm-commits] [llvm] r112084 - /llvm/trunk/lib/CodeGen/PrologEpilogInserter.cpp

Jim Grosbach grosbach at apple.com
Wed Aug 25 13:34:29 PDT 2010


Author: grosbach
Date: Wed Aug 25 15:34:28 2010
New Revision: 112084

URL: http://llvm.org/viewvc/llvm-project?rev=112084&view=rev
Log:
Add some statistics for PEI register scavenging

Modified:
    llvm/trunk/lib/CodeGen/PrologEpilogInserter.cpp

Modified: llvm/trunk/lib/CodeGen/PrologEpilogInserter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/PrologEpilogInserter.cpp?rev=112084&r1=112083&r2=112084&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/PrologEpilogInserter.cpp (original)
+++ llvm/trunk/lib/CodeGen/PrologEpilogInserter.cpp Wed Aug 25 15:34:28 2010
@@ -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 @@
 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 @@
             }
             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 @@
             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.





More information about the llvm-commits mailing list