[all-commits] [llvm/llvm-project] 1d9c7c: Increase performance of llvm-gsymutil by up to 200%.
Greg Clayton via All-commits
all-commits at lists.llvm.org
Tue Aug 1 13:48:23 PDT 2023
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 1d9c7c4161b9782ed3d0eae0ab776bc25678fd01
https://github.com/llvm/llvm-project/commit/1d9c7c4161b9782ed3d0eae0ab776bc25678fd01
Author: Greg Clayton <gclayton at fb.com>
Date: 2023-08-01 (Tue, 01 Aug 2023)
Changed paths:
M llvm/include/llvm/DebugInfo/GSYM/FunctionInfo.h
M llvm/include/llvm/DebugInfo/GSYM/GsymCreator.h
M llvm/include/llvm/DebugInfo/GSYM/InlineInfo.h
M llvm/lib/DebugInfo/GSYM/DwarfTransformer.cpp
M llvm/lib/DebugInfo/GSYM/GsymCreator.cpp
M llvm/lib/DebugInfo/GSYM/InlineInfo.cpp
M llvm/lib/DebugInfo/GSYM/ObjectFileTransformer.cpp
M llvm/test/tools/llvm-gsymutil/ARM_AArch64/fat-macho-dwarf.yaml
M llvm/test/tools/llvm-gsymutil/X86/elf-dwarf.yaml
M llvm/test/tools/llvm-gsymutil/X86/mach-dwarf.yaml
M llvm/unittests/DebugInfo/GSYM/GSYMTest.cpp
Log Message:
-----------
Increase performance of llvm-gsymutil by up to 200%.
llvm-gsymutil was maintaining an address ranges collection behind a mutex and having the multi-threaded code access this and hold the mutex was causing slowdown when converting DWARF to GSYM. This patch does the following:
- removes the "Ranges" variable from the GsymCreator and any functions and places that used it
- clients don't try to detect if a function has been added for an address range, we now remove any inferior copies of information in the GsymCreator::finalize() routine as was done before, we just have more items to remove, though performance is greator due to less mutex thread locking
- after I started adding all of the inferior funtion info objects the previous patch that tried to remove infrior debug info had bugs in it, so I replace the removeIfBinary() function in GsymCreator with a more efficient and easier to debug way to do things which copies items from the GsymCreator::Funcs into a new vector of FunctionInfo objects and then replaces GsymCreator::Funcs at the end.
- Sorting of FunctionInfo objects has been modified to also compare InlineInfo objects. We found cases where LTO was ruining inline function address ranges and we ended up with a variety of FunctionInfo objects for the same range that had varying amounts of valid debug info. This patch now ensure that two function info objects with different inline info for the same function address range, the best one will be picked to ensure the greatest fidelity.
- If we detect that a DW_TAG_subprogram has inline functions and after parsing it, we don't end up with any valid inline information, we set the optional to std::nullopt to avoid emitting empty inline information and wasting space.
My tests show a 200% perf increase on M1 macs and a 100% performance increase on linux machines for the same complex large DWARF input binary.
Differential Revision: https://reviews.llvm.org/D156773
More information about the All-commits
mailing list