summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
diff options
context:
space:
mode:
authorTeresa Johnson <tejohnson@google.com>2019-01-31 16:46:14 +0000
committerTeresa Johnson <tejohnson@google.com>2019-01-31 16:46:14 +0000
commit4877715ee693e8e2fc7e7d76aee8fb9bad26babe (patch)
tree345c699436ba3670c9b80fd0d42f2a8c7e1f1bb7 /llvm/lib/Transforms
parentbd7735f79765e826c23d48d23c0ad327c9393f90 (diff)
downloadbcm5719-llvm-4877715ee693e8e2fc7e7d76aee8fb9bad26babe.tar.gz
bcm5719-llvm-4877715ee693e8e2fc7e7d76aee8fb9bad26babe.zip
Revert "[ThinLTO] Rename COMDATs for COFF when promoting/renaming COMDAT leader"
This reverts commit r352763. Causing a couple bot failures, root cause pointed to by sanitizer bot: http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-fast/builds/28909/steps/annotate/logs/stdio Use after free. I understand the issue but will revert and test with fix before recommitting. llvm-svn: 352768
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r--llvm/lib/Transforms/Utils/FunctionImportUtils.cpp17
1 files changed, 0 insertions, 17 deletions
diff --git a/llvm/lib/Transforms/Utils/FunctionImportUtils.cpp b/llvm/lib/Transforms/Utils/FunctionImportUtils.cpp
index 84c360a17b5..a122b28e52e 100644
--- a/llvm/lib/Transforms/Utils/FunctionImportUtils.cpp
+++ b/llvm/lib/Transforms/Utils/FunctionImportUtils.cpp
@@ -248,7 +248,6 @@ void FunctionImportGlobalProcessing::processGlobalForThinLTO(GlobalValue &GV) {
bool DoPromote = false;
if (GV.hasLocalLinkage() &&
((DoPromote = shouldPromoteLocalToGlobal(&GV)) || isPerformingImport())) {
- auto Name = GV.getName();
// Once we change the name or linkage it is difficult to determine
// again whether we should promote since shouldPromoteLocalToGlobal needs
// to locate the summary (based on GUID from name and linkage). Therefore,
@@ -257,12 +256,6 @@ void FunctionImportGlobalProcessing::processGlobalForThinLTO(GlobalValue &GV) {
GV.setLinkage(getLinkage(&GV, DoPromote));
if (!GV.hasLocalLinkage())
GV.setVisibility(GlobalValue::HiddenVisibility);
-
- // If we are renaming a COMDAT leader, ensure that we record the COMDAT
- // for later renaming as well. This is required for COFF.
- if (const auto *C = GV.getComdat())
- if (C->getName() == Name)
- RenamedComdats.try_emplace(C, M.getOrInsertComdat(GV.getName()));
} else
GV.setLinkage(getLinkage(&GV, /* DoPromote */ false));
@@ -287,16 +280,6 @@ void FunctionImportGlobalProcessing::processGlobalsForThinLTO() {
processGlobalForThinLTO(SF);
for (GlobalAlias &GA : M.aliases())
processGlobalForThinLTO(GA);
-
- // Replace any COMDATS that required renaming (because the COMDAT leader was
- // promoted and renamed).
- if (!RenamedComdats.empty())
- for (auto &GO : M.global_objects())
- if (auto *C = GO.getComdat()) {
- auto Replacement = RenamedComdats.find(C);
- if (Replacement != RenamedComdats.end())
- GO.setComdat(Replacement->second);
- }
}
bool FunctionImportGlobalProcessing::run() {
OpenPOWER on IntegriCloud