[LLVMdev] measuring the stack size

Jonathan S. Shapiro shap at eros-os.com
Thu Apr 17 10:00:46 PDT 2008


On Thu, 2008-04-17 at 10:49 -0700, Chris Lattner wrote:
> On Thu, 17 Apr 2008, guan mailist wrote:
> > Does anyone have good ideas to dynamically measure the stack size of a
> > program by using LLVM.
> > I am trying to add some new intrinsic functions after each "alloca" in
> > bitcode. Is it a good way to do it?
> > Any existing tools can help me to do so?
> 
> Depending on how much precision you need, you could use the 
> llvm.frameaddress intrinsic.

Chris:

This prompts me to a related question. For procedures that do not call
alloca() at run time, is there a way to learn the stack frame size in
bytes for each procedure at static compile time?

shap




More information about the llvm-dev mailing list