[PATCH] D33548: [DWARF] - Cleanup relocation handling.

George Rimar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu May 25 05:51:16 PDT 2017


grimar created this revision.

Current version of Dwarf parser uses object::RelocVisitor for applying relocations.
And do that in a bit wierd way. It creates object::RelocVisitor object
for each relocation, though could do it once for file.

That happened because visit() function still check file type on each call and then
chooses which arch to use in a huge single method with use of lots helper function.

I was interested would it be any benefit if we change code to select proper architecture
and file type once during visitor creation. And implemented it for ELF x86_64 in this patch.

Numbers for me are 16,5909 ( +-  0,16% ) vs 16,3406  ( +-  0,19% ) for 25 runs of linking
llc binary with lld and -gdb-index. Difference is not much: 1,015, or up to 1% it seems for total link time.

Though this approach helps to split huge method and cleanup implementation. 
Interesting what other thinks about that.


https://reviews.llvm.org/D33548

Files:
  include/llvm/Object/RelocVisitor.h
  lib/DebugInfo/DWARF/DWARFContext.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D33548.100228.patch
Type: text/x-patch
Size: 4973 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170525/db61ab0a/attachment.bin>


More information about the llvm-commits mailing list