diff options
Diffstat (limited to 'llvm/lib/Transforms/IPO/FunctionImport.cpp')
-rw-r--r-- | llvm/lib/Transforms/IPO/FunctionImport.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/llvm/lib/Transforms/IPO/FunctionImport.cpp b/llvm/lib/Transforms/IPO/FunctionImport.cpp index 531a7c19e36..1223a23512e 100644 --- a/llvm/lib/Transforms/IPO/FunctionImport.cpp +++ b/llvm/lib/Transforms/IPO/FunctionImport.cpp @@ -777,9 +777,14 @@ void llvm::computeDeadSymbols( VI = updateValueInfoForIndirectCalls(Index, VI); if (!VI) return; - for (auto &S : VI.getSummaryList()) - if (S->isLive()) - return; + + // We need to make sure all variants of the symbol are scanned, alias can + // make one (but not all) alive. + if (llvm::all_of(VI.getSummaryList(), + [](const std::unique_ptr<llvm::GlobalValueSummary> &S) { + return S->isLive(); + })) + return; // We only keep live symbols that are known to be non-prevailing if any are // available_externally, linkonceodr, weakodr. Those symbols are discarded |