Dear All, 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? Any help will be deeply appreciated. Thank you, GUanhua -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20080417/42c36136/attachment.html>
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
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 -- http://nondot.org/sabre/ http://llvm.org/