[PATCH] D87970: [ThinLTO] Avoid temporaries when loading global decl attachment metadata

Teresa Johnson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 25 10:07:24 PDT 2020


tejohnson reopened this revision.
tejohnson added a comment.
This revision is now accepted and ready to land.

PTAL

I have a fix for the issue that required a revert. We shouldn't be using the lazy loading IndexCursor to load the global decl attachment metadata. That cursor is initialized with the necessary abbrev ids from the module level metadata block at the end of the lazy loading index setup, so that you can use those abbrev ids when jumping into random locations, as noted in the comment above its declaration:

  /// Cursor associated with the lazy-loading of Metadata. This is the easy way
  /// to keep around the right "context" (Abbrev list) to be able to jump in
  /// the middle of the metadata block and load any record.

This is only exposed in limited situations, since there are almost no abbrev ids used in the metadata block (basically only debug location records), and you need a debug location that used in certain ways and shared by multiple functions so that it ends up in the module level metadata block for lazy loading. I beefed up the test case to contain metadata on the imported module that exposes the failure without this fix.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D87970



More information about the llvm-commits mailing list