[LTO] Initialize canAutoHide() using canBeOmittedFromSymbolTable()
authorJez Ng <jezng@fb.com>
Fri, 4 Mar 2022 00:04:11 +0000 (19:04 -0500)
committerJez Ng <jezng@fb.com>
Fri, 4 Mar 2022 00:04:11 +0000 (19:04 -0500)
commitdd29597e103cd13dd308fb68283fce9d3411f723
treedb905e6468145487a35f4d8a264ec1c11a679136
parent5c268743da5818bc279b27648e9fccc37b9bb7dd
[LTO] Initialize canAutoHide() using canBeOmittedFromSymbolTable()

Per discussion on
https://reviews.llvm.org/D59709#inline-1148734, this seems like the
right course of action. `canBeOmittedFromSymbolTable()` subsumes and
generalizes the previous logic. In addition to handling `linkonce_odr`
`unnamed_addr` globals, we now also internalize `linkonce_odr` +
`local_unnamed_addr` constants.

Reviewed By: tejohnson

Differential Revision: https://reviews.llvm.org/D120173
lld/test/MachO/lto-internalize-unnamed-addr.ll
llvm/lib/Analysis/ModuleSummaryAnalysis.cpp
llvm/lib/Transforms/IPO/FunctionImport.cpp
llvm/test/ThinLTO/X86/Inputs/linkonce_odr_unnamed_addr.ll
llvm/test/ThinLTO/X86/linkonce_odr_unnamed_addr.ll