[PATCH] D48783: [ThinLTO] Use std::map for import lists to get determistic imports files

Teresa Johnson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 10 11:06:57 PDT 2018


tejohnson added a comment.

In https://reviews.llvm.org/D48783#1157681, @mehdi_amini wrote:

> std::map is usually fairly slow, have you considered sorting at the time you write to the file instead? That would add a slow step when writing the files but wouldn't affect any in-memory operation.


Actually...looking at the code and what I even wrote here in the description, I'm not sure why it didn't occur to me to simply use the std::map ModuleToSummariesForIndex we are already building for the purposes of writing the distributed index files. At least in the new LTO API, that is done just before calling EmitImportsFiles, so we have it on hand! For the old LTO API, that std::map is not being done yet, but this is just llvm-lto testing code, so I can add a call to the same llvm::gatherImportedSummariesForModule before invoking EmitImportsFiles.

Let me change my patch to do this...


Repository:
  rL LLVM

https://reviews.llvm.org/D48783





More information about the llvm-commits mailing list