[llvm] [Bitcode][NFC] Add abbrev for FUNC_CODE_DEBUG_LOC (PR #146497)

Jeremy Morse via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 1 11:44:33 PDT 2025


jmorse wrote:

> Huh, that seems like a lot for this one little record...

Alas I believe (96% confidence) it's the width of every abbreviated-code in a function-block, thus a very large number of records in the program grow by one bit, in both debug and non-debug modes.

> I wonder if there's any way to reduce that impact - can't make the abbrev condition on debug info, I guess - too early to know that.

Hhmmm -- the `ModuleBitcodeWriterBase` class does get constructed with a Module handy, and we could examine whether that Module had any compile-units? There would be a new failure mode, when a program contains a DILocation that gets emitted as a large abbrev but we didn't correctly determine that in advance and configured abbrevs to be small. I suppose we can scatter assertions to stop that.

Customising the abbrev width based on whether the module contains debug-info feels awkward; but on the other hand, this is the benefit of bitcode abbrevs being emitted inline, we get to customise them without any kind of compatibility issues. Plus with that precedent, we can add some more abbrevs for RemoveDIs records to reduce filesize further, without non-debug builds paying a price.

https://github.com/llvm/llvm-project/pull/146497


More information about the llvm-commits mailing list