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

Jakob Stoklund Olesen stoklund at 2pi.dk
Thu Aug 4 14:06:09 PDT 2011


Author: stoklund
Date: Thu Aug  4 16:06:09 2011
New Revision: 136921

URL: http://llvm.org/viewvc/llvm-project?rev=136921&view=rev
Log:
Count the total amount of stack space used in compiled functions.

Patch by Ivan Krasin!

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=136921&r1=136920&r2=136921&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/PrologEpilogInserter.cpp (original)
+++ llvm/trunk/lib/CodeGen/PrologEpilogInserter.cpp Thu Aug  4 16:06:09 2011
@@ -54,6 +54,7 @@
 
 STATISTIC(NumVirtualFrameRegs, "Number of virtual frame regs encountered");
 STATISTIC(NumScavengedRegs, "Number of frame index regs scavenged");
+STATISTIC(NumBytesStackSpace, "Number of bytes used for stack in all functions");
 
 /// createPrologEpilogCodeInserter - This function returns a pass that inserts
 /// prolog and epilog code, and eliminates abstract frame references.
@@ -677,7 +678,9 @@
   }
 
   // Update frame info to pretend that this is part of the stack...
-  MFI->setStackSize(Offset - LocalAreaOffset);
+  int64_t StackSize = Offset - LocalAreaOffset;
+  MFI->setStackSize(StackSize);
+  NumBytesStackSpace += StackSize;
 }
 
 /// insertPrologEpilogCode - Scan the function for modified callee saved





More information about the llvm-commits mailing list