[llvm] [BOLT] Improve handling of relocations targeting specific instructions (PR #66395)

Rafael Auler via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 4 15:10:06 PDT 2023


rafaelauler wrote:

Adding data structures to BinaryFunction class is a bit expensive for us because it increases our memory footprint -- an uninitialized std::map<> will cost 48 bytes, which means an additional 5MB for 100k BinaryFunction objects loaded at runtime. The x86 target primarily deals with very large binaries, so it will be good if this solution could be mindful of that and perhaps reduce the memory footprint for x86 that will likely not use this additional InstructionLabels data structure. Perhaps convert it to an std::optional<std::map>? Or better yet, maybe try to reuse the existing Relocations map that we have in BF and register your relocs there, then fetch that in ::disassemble() to try to fill up your new annotations?


https://github.com/llvm/llvm-project/pull/66395


More information about the llvm-commits mailing list