[PATCH] D68620: DebugInfo: Use base address selection entries for debug_loc

David Blaikie via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 15 12:03:11 PDT 2020


dblaikie added a comment.

In D68620#2274165 <https://reviews.llvm.org/D68620#2274165>, @Orlando wrote:

>> @Orlando mentioned he was collecting some size data that would be relevant here, he'll post it when he's done. Basically .debug_loc sizes at various points.
>
> Hi!
>
> I've built a benchmark suite of 85 programs with "-O2 -g" with our downstream branch targeting X86 emitting DWARF v4.
>
> This table provides a summary of the data. It shows the mean for some size data normalized as a percentage of the llvm-3 results for each benchmark.
>
> For reference:
> Largest binary built with llvm-3: 6010 kB
> Smallest binary built with llvm-3: 79 kB
>
>   +------------------------------------------------------------------------------------------- +
>   | Mean binary size for benchmarks normalized as a percentage of llvm-3 builds                |
>   +---------------------------------+------------+------------------+-----------------+--------+
>   | llvm version                    | .debug_loc | other debug info | everything else | Total  |
>   +---------------------------------+------------+------------------+-----------------+--------+
>   | llvm-3                          | 13.7       | 33.2             | 53.1            | 100    |
>   | llvm-4                          | 12.7       | 33.8             | 53.8            | 100.3  |
>   | llvm-5                          | 13.4       | 35.6             | 54.6            | 103.7  |
>   | llvm-7                          | 18.4       | 35.6             | 54.0            | 108.0  |
>   | llvm-8                          | 17.5       | 37.1             | 54.5            | 109.1  |
>   | llvm-9                          | 19.7       | 37.2             | 54.6            | 111.5  |
>   | llvm-10 before dblaikie commit  | 19.8       | 37.4             | 54.9            | 112.1  |
>   | llvm-10 with dblaikie commit    | 25.6       | 37.4             | 54.9            | 117.9  |
>   | llvm-10                         | 25.8       | 37.5             | 54.8            | 118.1  |
>   | llvm-master before my commits   | 26.2       | 37.4             | 54.8            | 118.4  |
>   | llvm-master with my commits     | 18.4       | 35.5             | 55.3            | 109.3  |
>   +---------------------------------+------------+------------------+-----------------+--------+
>
> Here's an image of that data in graph form: M3 <https://reviews.llvm.org/M3>.
>
> The llvm-6 entry has been omitted because the non debug-info size is a distracting outlier. The .debug_loc section size is ~16.5% for that one.
>
> If you'd like to see the data in another format or see data for the benchmarks individually please let me know.

Thanks for the data!

(as an aside: do you/@probinson have much of a sense of how much binary size increase you'd trade for object size reductions in this space? If binary size is ulmtimately what you care most about, I'm guessing maybe debug_loc base address specifiers will never be a win for you & perhaps we should just group them under a flag, maybe refactor the debug_ranges base address specifier flag to cover both (the flag there was introduced due to a gold+gdb_index+32 bit binary bug, unfortunately, but lumping them together seems OK-ish to me))

When you say "llvm-master before/after your commits" - what version of llvm-master and what commits did you have to test with? (if you can/want to discuss them)

I'm rather surprised, if master was moderately recent, that it shows no benefit from https://reviews.llvm.org/rG57d8acac64b87cb4286b00485fb2da7521fc091e (perhaps, if it's not too much hassle, you could run a sample benchmark before/after that change?)


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D68620



More information about the llvm-commits mailing list