<DIV>Thanks a lot Chris.</DIV>
<DIV> </DIV>
<DIV>Regarding basic block size I wish to calculate both:</DIV>
<DIV> </DIV>
<DIV>- The number of bytecode bytes</DIV>
<DIV>-  The number of machine code bytes for some target?</DIV>
<DIV> </DIV>
<DIV>TS<BR><BR><BR><B><I>Chris Lattner <sabre@nondot.org></I></B> wrote:</DIV>
<BLOCKQUOTE class=replbq style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #1010ff 2px solid">On Thu, 7 Apr 2005, Tanu Sharma wrote:<BR><BR>> Thanks for the reply,<BR>><BR>> Actually I m aiming towards determining two values:<BR>><BR>> - number of basic blocks in a program For this I have used Statistic <BR>> facility provided in llvm and increasing the counter for each basic <BR>> block for each function.but for some reason , I m getting different <BR>> number everytime !! Is Statistic is the right way to do it ?<BR><BR>That should work fine. Remember that statistics accumulate across the <BR>whole execution of the tool though, they are not reset per function. <BR>Also, you might want to check out the -instcount pass. It prints BB <BR>counts among other things.<BR><BR>For a small .ll file, it prints:<BR><BR>$ llvm-as < t.ll | analyze -instcount -stats<BR>Printing analysis 'Counts the various types of Instructions' for function
 <BR>'test':<BR>===-------------------------------------------------------------------------===<BR>... Statistics Collected ...<BR>===-------------------------------------------------------------------------===<BR><BR>1 instcount - Number of Cast insts<BR>1 instcount - Number of Store insts<BR>1 instcount - Number of SetLT insts<BR>1 instcount - Number of Ret insts<BR>1 instcount - Number of memory instructions<BR>1 instcount - Number of non-external functions<BR>1 instcount - Number of basic blocks<BR>4 instcount - Number of instructions (of all types)<BR><BR><BR>> - Average basic block size in a program ( in bytes)<BR>> Any suggestions to make it simple and get an accurate result?<BR><BR>What are you trying to measure? The in-memory footprint of hte LLVM IR? <BR>The number of bytecode bytes? The number of machine code bytes for some <BR>target?<BR><BR>-Chris<BR><BR>><BR>> Regards,<BR>> Tanu<BR>><BR>><BR>> Chris Lattner <SABRE@NONDOT.ORG>wrote:<BR>&g!
 t; On
 Tue, 5 Apr 2005, Tanu Sharma wrote:<BR>><BR>>> There is tool that calculates execution count and total number of blocks<BR>>> , is there anything available to detemine size of basic blocks in a<BR>>> program in bytes?<BR>><BR>> Are you talking about native code? If you run the 'size' utility in unix,<BR>> the 'tex' value is the number of bytes of program code. If you're talking<BR>> about llvm code, I'm not sure what you mean "size of basic blocks in a<BR>> program in bytes".<BR>><BR>> -Chris<BR>><BR>><BR><BR>-Chris<BR><BR>-- <BR>http://nondot.org/sabre/<BR>http://llvm.cs.uiuc.edu/<BR><BR>_______________________________________________<BR>LLVM Developers mailing list<BR>LLVMdev@cs.uiuc.edu http://llvm.cs.uiuc.edu<BR>http://mail.cs.uiuc.edu/mailman/listinfo/llvmdev<BR></BLOCKQUOTE><p>
                <hr size=1>Do you Yahoo!?<br> 
<a href="http://us.rd.yahoo.com/my/navbar/sethp/*http://www.yahoo.com/r/hs">Make Yahoo! your home page</a>