[PATCH] D96035: [WIP][dsymutil][DWARFlinker] implement separate multi-thread processing for compile units.

Alexey Lapshin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 6 06:52:17 PDT 2021


avl added a comment.

@JDevlieghere @aprantl  @clayborg @friss @echristo

Folks, What is your opinion on this patch? Would it be useful to integrate?

The patch implements two features:

1. Types deduplication by merging. It merges all partial type definitions/declarations into a single description to avoid types duplications. This approach allows the generation .debug_info table of 50% less in size.

2. Parallel execution. It allows speed-up execution if the hardware has available threads.

Current size/performance results are(compared with llvm upstream dsymutil):

- .debug_info table of 40% less in size.
- single-threaded mode works 1.7x slower.
- multy-thread mode works up to 2x faster.

There is a number of things which might improve the result:

1. Deduplicate types defined in DW_TAG_subprograms with DW_AT_specification attribute.

2. (probably)Deduplicate abstract inline instances.

3. Use another memory pool for dies. Instead of BumpPtrAllocator use a pre-allocated pool. It would reduce data fragmentation.

4. Current version of the patch uses two different memory pools(because of interfaces dependencies) with duplicated data: MTSafeStringTable and NonRelocatableStringpool. Using only one kind of pool would help to reduce memory usage and to improve performance numbers.

5. Improve Dies navigation - https://reviews.llvm.org/D102634#inline-971772.

6. Generate index tables in parallel.

7. Avoid gluing generated tables into a single file. Use tables, generated for compilation units, as the output. It would allow avoiding data copying. Consumers might write compilation units tables directly so we do not need to create an intermediate output file.

So, I think we might have(after above is done) a single-threaded performance to be 1.3-1.5 slower than current dsymutil, multi-threaded performance up to 3x faster.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D96035/new/

https://reviews.llvm.org/D96035



More information about the llvm-commits mailing list