[llvm-commits] PrologEpilogInserter: add total stack size statistic
Cameron Zwarich
zwarich at apple.com
Thu Aug 4 13:51:47 PDT 2011
The name NumTotalStackSize is a bit odd. It should be something like either NumBytesStackSpace or TotalStackSpace.
Cameron
On Aug 4, 2011, at 1:43 PM, Ivan Krasin wrote:
> HI llvm team,
>
> this patch adds a new statistic proposed by Jakob: Number of bytes
> used for stack in all function. For instance, it would make it easier
> to measure progress/regress of instruction selectors and register
> allocators.
>
> Ivan Krasin
>
> Index: lib/CodeGen/PrologEpilogInserter.cpp
> ===================================================================
> --- lib/CodeGen/PrologEpilogInserter.cpp (revision 136909)
> +++ lib/CodeGen/PrologEpilogInserter.cpp (working copy)
> @@ -54,6 +54,7 @@
>
> STATISTIC(NumVirtualFrameRegs, "Number of virtual frame regs encountered");
> STATISTIC(NumScavengedRegs, "Number of frame index regs scavenged");
> +STATISTIC(NumTotalStackSize, "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);
> + int StackSize = Offset - LocalAreaOffset;
> + MFI->setStackSize(StackSize);
> + NumTotalStackSize += StackSize;
> }
>
> /// insertPrologEpilogCode - Scan the function for modified callee saved
> <total_stack_size.patch>_______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
More information about the llvm-commits
mailing list