Is there any way to get a rough size estimate for functions in IR? Say I have a bitcode file that contains the definition of several classes. I'd like to be able to read in the file and report 'class A is roughly twice as big as class B', or 'This file consists of 60% class A, 30% class B, and 10% class C'. The numbers would be a rough relative measurement of the size of all globals and methods of the class, but they wouldn't have to correspond to the exact byte size of the final executable. Basically what I want to do is track over time the amount of overhead caused by language features such as reflection and other metadata. -- -- Talin -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20091206/c1cd7ca7/attachment.html>
On Dec 6, 2009, at 2:46 PM, Talin wrote:> Is there any way to get a rough size estimate for functions in IR? Say I have a bitcode file that contains the definition of several classes. I'd like to be able to read in the file and report 'class A is roughly twice as big as class B', or 'This file consists of 60% class A, 30% class B, and 10% class C'. The numbers would be a rough relative measurement of the size of all globals and methods of the class, but they wouldn't have to correspond to the exact byte size of the final executable. > > Basically what I want to do is track over time the amount of overhead caused by language features such as reflection and other metadata."opt -stats -inst-count" will tell you the #instructions of various sorts. -Chris