aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/LTO/LTOBackend.cpp
diff options
context:
space:
mode:
authorMingming Liu <mingmingl@google.com>2024-06-05 10:06:55 -0700
committerGitHub <noreply@github.com>2024-06-05 10:06:55 -0700
commit707f4de4289e48e8a17bd0c9eb429d0c98061ecd (patch)
tree8a119360ff99a5a85ffe69ed7839fdbbb0b07fe1 /llvm/lib/LTO/LTOBackend.cpp
parent53061eecdbd9ffc77a43f85b6c4e145a242a27a4 (diff)
downloadllvm-707f4de4289e48e8a17bd0c9eb429d0c98061ecd.zip
llvm-707f4de4289e48e8a17bd0c9eb429d0c98061ecd.tar.gz
llvm-707f4de4289e48e8a17bd0c9eb429d0c98061ecd.tar.bz2
Revert "Reland "[ThinLTO] Populate declaration import status except for distributed ThinLTO under a default-off new option" (#92718) (#94503)
This reverts commit e33db249b53fb70dce62db3ebd82d42239bd1d9d. The change from *set to *map increases memory usage, and caused indexing OOM in some applications. Need to profile offline to bring the memory usage down.
Diffstat (limited to 'llvm/lib/LTO/LTOBackend.cpp')
-rw-r--r--llvm/lib/LTO/LTOBackend.cpp9
1 files changed, 1 insertions, 8 deletions
diff --git a/llvm/lib/LTO/LTOBackend.cpp b/llvm/lib/LTO/LTOBackend.cpp
index 76223e8..21aed79 100644
--- a/llvm/lib/LTO/LTOBackend.cpp
+++ b/llvm/lib/LTO/LTOBackend.cpp
@@ -720,14 +720,7 @@ bool lto::initImportList(const Module &M,
if (Summary->modulePath() == M.getModuleIdentifier())
continue;
// Add an entry to provoke importing by thinBackend.
- // Try emplace the entry first. If an entry with the same key already
- // exists, set the value to 'std::min(existing-value, new-value)' to make
- // sure a definition takes precedence over a declaration.
- auto [Iter, Inserted] = ImportList[Summary->modulePath()].try_emplace(
- GUID, Summary->importType());
-
- if (!Inserted)
- Iter->second = std::min(Iter->second, Summary->importType());
+ ImportList[Summary->modulePath()].insert(GUID);
}
}
return true;