[PATCH] D77639: [DebugInfo][NFC] Early-exit when analysing for single-location variables

Jeremy Morse via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 8 05:23:23 PDT 2020


jmorse added a comment.

Thanks for the reviews,

David wrote:

> (It would be interesting to revisit this "Single, constant DBG_VALUEs" behavior sometime in the future, but I don't expect you do that just because you improved the performance of the existing behavior.)

Weeelllll, I did toy with this a while back, I think the fact that we only emit single locations for "open ended" (i.e. is the last block in the function) locations is a large limitation. I tried inserting another piece of linear-scanning code [0] to test the following:

- The lexical scope only covers one block (this one),
- The variable location starts before/at the start of the scope,
- The variable location ends at/after the end of the scope

Of which the third test is new, and the first two are already tested by validThroughout.

The result was, on a clang-trunk stage2reldeb build on Ubuntu 18.04:

- a 27% reduction in the size of .debug_loc (450MiB -> 329MiB),
- Leading to a 6% reduction in binary size overall (2077MiB -> 1954MiB).

Which is quite attractive. Pursuing this involves making an argument that representing this situation with a single-location in DWARF, and I'm not familiar enough with DWARF right now.  The hard part however is doing this efficiently, as touching every instruction in a block for every variable doesn't scale. (If anyone picks this up, please let me know, otherwise we'll eventually get around to addressing this).

[0] https://github.com/jmorse/llvm-project/commit/903338d971c9c1c9c46a6e1aebc6f1e1b405d37c


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D77639





More information about the llvm-commits mailing list