[llvm] [ThinLTO] Populate declaration import status except for distributed ThinLTO under a default-off new option (PR #88024)

Teresa Johnson via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 6 08:54:46 PDT 2024


teresajohnson wrote:

> > FWIW, if I remember correctly from trying some versions of this, I think DenseMap for `FunctionsToImportTy` might have used much more memory than unordered_map (and the original unordered_set).
> 
> Thanks for this info! To optimize the memory usage of this patch, I'm thinking about to storing per-module imported declaration set as another `DenseMap<StringRef, unordered_set<uint64_t>>`. With selective declaration import, this map should be small.
> 
> Note this will duplicate module paths (`StringRef` as key) in the map.

This would only duplicate the StringRef, not the whole string though I think? The module path strings should only be stored in the ModulePathStringTable.

> It might be possible to have a separate map (`DenseMap<StringRef, int>`) to map module path into integers for `ImportLists` and `ExportLists`, and store integers in other map keys.

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


More information about the llvm-commits mailing list