Skip to content

Commit e95901c

Browse files
committed
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
1 parent e59d06f commit e95901c

File tree

2 files changed

+0
-16
lines changed

2 files changed

+0
-16
lines changed

llvm/lib/Analysis/ModuleSummaryAnalysis.cpp

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -451,12 +451,6 @@ ModuleSummaryIndex llvm::buildModuleSummaryIndex(
451451
auto &Summary = GlobalList.second[0];
452452
bool AllRefsCanBeExternallyReferenced =
453453
llvm::all_of(Summary->refs(), [&](const ValueInfo &VI) {
454-
// If a global value definition references an unnamed global,
455-
// be conservative. They're valid IR so we don't want to crash
456-
// when we encounter any of them but they're infrequent enough
457-
// that we don't bother optimizing them.
458-
if (!VI.getValue()->hasName())
459-
return false;
460454
return !CantBePromoted.count(VI.getValue()->getGUID());
461455
});
462456
if (!AllRefsCanBeExternallyReferenced) {

llvm/test/Transforms/FunctionImport/unnamed-globals.ll

Lines changed: 0 additions & 10 deletions
This file was deleted.

0 commit comments

Comments
 (0)