[clang] [llvm] [LTO] Reduce memory usage for import lists (PR #106772)

2024-09-02 Thread Kazu Hirata via cfe-commits
kazutakahirata wrote: > > It looks like this causes a compile-time regression. The clang thin link > > time increases by 1% > > (https://llvm-compile-time-tracker.com/compare_clang.php?from=9ccf82543d509bb5a0f5d0551fc4d6c1913b9a9b&to=5c0d61e318a77434487fcec8361d8110fb06e59d&stat=instructions%3A

[clang] [llvm] [LTO] Reduce memory usage for import lists (PR #106772)

2024-09-01 Thread Kazu Hirata via cfe-commits
kazutakahirata wrote: > It looks like this causes a compile-time regression. The clang thin link time > increases by 1% > (https://llvm-compile-time-tracker.com/compare_clang.php?from=9ccf82543d509bb5a0f5d0551fc4d6c1913b9a9b&to=5c0d61e318a77434487fcec8361d8110fb06e59d&stat=instructions%3Au). >

[clang] [llvm] [LTO] Reduce memory usage for import lists (PR #106772)

2024-09-01 Thread Nikita Popov via cfe-commits
nikic wrote: It looks like this causes a compile-time regression. The clang thin link time increases by 1% (https://llvm-compile-time-tracker.com/compare_clang.php?from=9ccf82543d509bb5a0f5d0551fc4d6c1913b9a9b&to=5c0d61e318a77434487fcec8361d8110fb06e59d&stat=instructions%3Au). There is no regr

[clang] [llvm] [LTO] Reduce memory usage for import lists (PR #106772)

2024-09-01 Thread Kazu Hirata via cfe-commits
https://github.com/kazutakahirata closed https://github.com/llvm/llvm-project/pull/106772 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [LTO] Reduce memory usage for import lists (PR #106772)

2024-08-30 Thread Kazu Hirata via cfe-commits
@@ -1827,15 +1831,13 @@ Expected FunctionImporter::importFunctions( if (Error Err = SrcModule->materializeMetadata()) return std::move(Err); -auto &ImportGUIDs = FunctionsToImportPerModule->second; - // Find the globals to import SetVector GlobalsToImpo

[clang] [llvm] [LTO] Reduce memory usage for import lists (PR #106772)

2024-08-30 Thread Kazu Hirata via cfe-commits
@@ -215,13 +215,49 @@ class FunctionImporter { SmallVector getSourceModules() const; std::optional -getImportType(const FunctionsToImportTy &GUIDToImportType, - GlobalValue::GUID GUID) const; +getImportType(StringRef FromModule, GlobalValue::GU

[clang] [llvm] [LTO] Reduce memory usage for import lists (PR #106772)

2024-08-30 Thread Kazu Hirata via cfe-commits
https://github.com/kazutakahirata updated https://github.com/llvm/llvm-project/pull/106772 >From 2013008e1e0cf7df73b735d1ecfaf927b49542fd Mon Sep 17 00:00:00 2001 From: Kazu Hirata Date: Thu, 29 Aug 2024 09:44:16 -0700 Subject: [PATCH 1/2] [LTO] Reduce memory usage for import lists This patch

[clang] [llvm] [LTO] Reduce memory usage for import lists (PR #106772)

2024-08-30 Thread Mingming Liu via cfe-commits
@@ -215,13 +215,49 @@ class FunctionImporter { SmallVector getSourceModules() const; std::optional -getImportType(const FunctionsToImportTy &GUIDToImportType, - GlobalValue::GUID GUID) const; +getImportType(StringRef FromModule, GlobalValue::GU

[clang] [llvm] [LTO] Reduce memory usage for import lists (PR #106772)

2024-08-30 Thread Mingming Liu via cfe-commits
@@ -1827,15 +1831,13 @@ Expected FunctionImporter::importFunctions( if (Error Err = SrcModule->materializeMetadata()) return std::move(Err); -auto &ImportGUIDs = FunctionsToImportPerModule->second; - // Find the globals to import SetVector GlobalsToImpo

[clang] [llvm] [LTO] Reduce memory usage for import lists (PR #106772)

2024-08-30 Thread Kazu Hirata via cfe-commits
@@ -174,51 +174,33 @@ std::string llvm::computeLTOCacheKey( for (auto GUID : ExportsGUID) Hasher.update(ArrayRef((uint8_t *)&GUID, sizeof(GUID))); - // Include the hash for every module we import functions from. The set of - // imported symbols for each module may affe

[clang] [llvm] [LTO] Reduce memory usage for import lists (PR #106772)

2024-08-30 Thread Jan Voung via cfe-commits
@@ -174,51 +174,33 @@ std::string llvm::computeLTOCacheKey( for (auto GUID : ExportsGUID) Hasher.update(ArrayRef((uint8_t *)&GUID, sizeof(GUID))); - // Include the hash for every module we import functions from. The set of - // imported symbols for each module may affe

[clang] [llvm] [LTO] Reduce memory usage for import lists (PR #106772)

2024-08-30 Thread Jan Voung via cfe-commits
https://github.com/jvoung edited https://github.com/llvm/llvm-project/pull/106772 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [LTO] Reduce memory usage for import lists (PR #106772)

2024-08-30 Thread Jan Voung via cfe-commits
https://github.com/jvoung approved this pull request. Nice! LG https://github.com/llvm/llvm-project/pull/106772 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [LTO] Reduce memory usage for import lists (PR #106772)

2024-08-30 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang @llvm/pr-subscribers-llvm-transforms @llvm/pr-subscribers-clang-codegen Author: Kazu Hirata (kazutakahirata) Changes This patch reduces the memory usage for import lists by employing memory-efficient data structures. With this patch, an import lis

[clang] [llvm] [LTO] Reduce memory usage for import lists (PR #106772)

2024-08-30 Thread Kazu Hirata via cfe-commits
https://github.com/kazutakahirata created https://github.com/llvm/llvm-project/pull/106772 This patch reduces the memory usage for import lists by employing memory-efficient data structures. With this patch, an import list for a given destination module is basically DenseSet with each element i