[llvm-dev] Obtaining the actual size of basic blocks (BBs) in bytes and the number of fixups of each BB

Hyungjoon Koo via llvm-dev llvm-dev at lists.llvm.org
Sun Dec 11 21:54:39 PST 2016


Hello,

I am working on my research using LLVM.

I need to obtain the following information at each object file during
compilation, and want to store them into the new section that I define.
Currently the target architecture is x86_64 with ELF format.


*a) actual size of basic blocks in bytes to be emitted *
*b) number of fixups (adjusted in MCAssembler.cpp) that belong to each
basic block *

I have tried to understand the backend codes, but I was not able to
get the actual
size of basic blocks in either code generation or MC layer. By the time of
emitting the actual bytes, I could only see the unit of the fragment
without the boundary of functions and basic blocks.

I need to know how many fixups (for reference updates) reside in each basic
block as well, but I could not find any link to get basic block information
in MC layer.

Finally, if there is any guide to define new section (and its header),
please let me know. Any direction to start with would be appreciated.

Thanks a lot for your help in advance!

Best Regards,
​
Kevin
​ ​
Koo
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20161212/bc9234a8/attachment.html>


More information about the llvm-dev mailing list