aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Analysis/ModuleSummaryAnalysis.cpp
diff options
context:
space:
mode:
authorPeter Collingbourne <peter@pcc.me.uk>2017-05-03 00:18:48 +0000
committerPeter Collingbourne <peter@pcc.me.uk>2017-05-03 00:18:48 +0000
commite95901caa41d4836b86241fd0a8db94dde0ca557 (patch)
tree87d2517bace1f5ba9912d8287f80ec5cec81dd96 /llvm/lib/Analysis/ModuleSummaryAnalysis.cpp
parente59d06fe78fd3ec58a247b7af42b59013a61ac5e (diff)
downloadllvm-e95901caa41d4836b86241fd0a8db94dde0ca557.zip
llvm-e95901caa41d4836b86241fd0a8db94dde0ca557.tar.gz
llvm-e95901caa41d4836b86241fd0a8db94dde0ca557.tar.bz2
Revert r295861, "[ModuleSummaryAnalysis] Don't crash when referencing unnamed globals."
We should always expect values to be named before running the module summary analysis (see NameAnonGlobals pass), so it's fine if we crash in that case. llvm-svn: 301991
Diffstat (limited to 'llvm/lib/Analysis/ModuleSummaryAnalysis.cpp')
-rw-r--r--llvm/lib/Analysis/ModuleSummaryAnalysis.cpp6
1 files changed, 0 insertions, 6 deletions
diff --git a/llvm/lib/Analysis/ModuleSummaryAnalysis.cpp b/llvm/lib/Analysis/ModuleSummaryAnalysis.cpp
index f6d9a73..a8341250 100644
--- a/llvm/lib/Analysis/ModuleSummaryAnalysis.cpp
+++ b/llvm/lib/Analysis/ModuleSummaryAnalysis.cpp
@@ -451,12 +451,6 @@ ModuleSummaryIndex llvm::buildModuleSummaryIndex(
auto &Summary = GlobalList.second[0];
bool AllRefsCanBeExternallyReferenced =
llvm::all_of(Summary->refs(), [&](const ValueInfo &VI) {
- // If a global value definition references an unnamed global,
- // be conservative. They're valid IR so we don't want to crash
- // when we encounter any of them but they're infrequent enough
- // that we don't bother optimizing them.
- if (!VI.getValue()->hasName())
- return false;
return !CantBePromoted.count(VI.getValue()->getGUID());
});
if (!AllRefsCanBeExternallyReferenced) {