mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-02-23 14:03:14 +00:00
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
This commit is contained in:
parent
0808c94b7f
commit
2a1a60861c
@ -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) {
|
||||
|
@ -1,10 +0,0 @@
|
||||
; Make sure we don't crash when referencing an unnamed global.
|
||||
; RUN: opt %s -module-summary-analysis -S
|
||||
|
||||
@0 = external global [1 x { i64 }]
|
||||
|
||||
define internal void @tinkywinky() {
|
||||
call void @patatino(i64 ptrtoint ([1 x { i64 }]* @0 to i64), i64 4)
|
||||
ret void
|
||||
}
|
||||
declare void @patatino(i64, i64)
|
Loading…
x
Reference in New Issue
Block a user