diff options
author | Vitaly Buka <vitalybuka@google.com> | 2025-03-07 18:59:48 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-03-07 18:59:48 -0800 |
commit | 7dd5f2327955458f0aaf1c8cf27dbd684c0a3453 (patch) | |
tree | 79cedd020a0200ed5485b41c0d3e9f17c9aaf9bc /llvm/lib/LTO/LTO.cpp | |
parent | 3121da52aa788199185585aa11f3d55b03adc93d (diff) | |
download | llvm-7dd5f2327955458f0aaf1c8cf27dbd684c0a3453.zip llvm-7dd5f2327955458f0aaf1c8cf27dbd684c0a3453.tar.gz llvm-7dd5f2327955458f0aaf1c8cf27dbd684c0a3453.tar.bz2 |
[NFC][LTO] Move GUID calculation into CfiFunctionIndex (#130370)
Preparation for CFI Index refactoring,
which will fix O(N^2) in ThinLTO indexing.
Diffstat (limited to 'llvm/lib/LTO/LTO.cpp')
-rw-r--r-- | llvm/lib/LTO/LTO.cpp | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/llvm/lib/LTO/LTO.cpp b/llvm/lib/LTO/LTO.cpp index dfd4b51..e895a46 100644 --- a/llvm/lib/LTO/LTO.cpp +++ b/llvm/lib/LTO/LTO.cpp @@ -1437,12 +1437,10 @@ public: OnWrite, ShouldEmitImportsFiles, ThinLTOParallelism), AddStream(std::move(AddStream)), Cache(std::move(Cache)), ShouldEmitIndexFiles(ShouldEmitIndexFiles) { - for (auto &Name : CombinedIndex.cfiFunctionDefs()) - CfiFunctionDefs.insert( - GlobalValue::getGUID(GlobalValue::dropLLVMManglingEscape(Name))); - for (auto &Name : CombinedIndex.cfiFunctionDecls()) - CfiFunctionDecls.insert( - GlobalValue::getGUID(GlobalValue::dropLLVMManglingEscape(Name))); + auto &Defs = CombinedIndex.cfiFunctionDefs(); + CfiFunctionDefs.insert(Defs.guid_begin(), Defs.guid_end()); + auto &Decls = CombinedIndex.cfiFunctionDecls(); + CfiFunctionDecls.insert(Decls.guid_begin(), Decls.guid_end()); } virtual Error runThinLTOBackendThread( @@ -1965,12 +1963,10 @@ Error LTO::runThinLTO(AddStreamFn AddStream, FileCache Cache, // Any functions referenced by the jump table in the regular LTO object must // be exported. - for (auto &Def : ThinLTO.CombinedIndex.cfiFunctionDefs()) - ExportedGUIDs.insert( - GlobalValue::getGUID(GlobalValue::dropLLVMManglingEscape(Def))); - for (auto &Decl : ThinLTO.CombinedIndex.cfiFunctionDecls()) - ExportedGUIDs.insert( - GlobalValue::getGUID(GlobalValue::dropLLVMManglingEscape(Decl))); + auto &Defs = ThinLTO.CombinedIndex.cfiFunctionDefs(); + ExportedGUIDs.insert(Defs.guid_begin(), Defs.guid_end()); + auto &Decls = ThinLTO.CombinedIndex.cfiFunctionDecls(); + ExportedGUIDs.insert(Decls.guid_begin(), Decls.guid_end()); auto isExported = [&](StringRef ModuleIdentifier, ValueInfo VI) { const auto &ExportList = ExportLists.find(ModuleIdentifier); |