[llvm-dev] [RFC] Lazy-loading of debug info metadata

Duncan P. N. Exon Smith via llvm-dev llvm-dev at lists.llvm.org
Wed Mar 23 23:06:40 PDT 2016


> On 2016-Mar-22, at 19:28, Duncan P. N. Exon Smith via llvm-dev <llvm-dev at lists.llvm.org> wrote:
> 
> 1. If a piece of metadata is referenced from only a single `Function`,
>    serialize that metadata in the function's metadata block instead of
>    the global metadata block.
> 
>    This addresses problems (a) and (b), primarily targeting
>    `DILocation`s.  It should pick up lots of other stuff, depending on
>    how much inlining has happened.
> 
>    (I have a draft of the writer side, still working on the reader.)

Teresa: I had trouble make this work with the delayed metadata parsing
(the logic around "SeenModuleValuesRecord").  My WIP patch rips that
out rather unceremoniously.

(Attached the patch for reference, but it needs to be cleaned up, split
up, etc.; not ready for review (although comments always welcome)).

My understanding from Mehdi is that maybe ThinLTO isn't currently
relying on the delayed parsing.  I.e., the original scheme was:
- cherry-pick functions one at a time (never reading metadata), then
- come back at the end to read the metadata all at once.
But the scheme has evolved to:
- calculate the desired functions from each module, then
- load the module and link all the functions in one go.

Is that accurate?  If so, I don't see remaining benefit in delaying the
global metadata parsing, just an extra code path to maintain.  Do you
agree?

-------------- next part --------------
A non-text attachment was scrubbed...
Name: function-local-metadata-v1.patch
Type: application/octet-stream
Size: 27510 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20160323/0b19393f/attachment-0001.obj>


More information about the llvm-dev mailing list