[PATCH] D121428: [lld-macho] Extend lto-internalize-unnamed-addr.ll
Jez Ng via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Mar 14 10:23:49 PDT 2022
int3 added inline comments.
================
Comment at: lld/test/MachO/lto-internalize-unnamed-addr.ll:47
+; THINLTO-BC-DAG: @local_unnamed_sometimes_const = weak_odr local_unnamed_addr constant i8 42
+; THINLTO-BC-DAG: @local_unnamed = weak_odr local_unnamed_addr global i8 42
+
----------------
modimo wrote:
> I find it odd that `local_unnamed` is able to be internalized in fullLTO but not thinLTO. The code path is https://github.com/llvm/llvm-project/blob/9f616a467fc710f084b7e57812a2ed64c214c2c6/llvm/lib/LTO/LTO.cpp#L349 where any linkonce_odr gets upgraded to weak but if this is the only copy that exists it appears to fit within the rules coming from D20348. cc @tejohnson is there an opportunity here?
I realize `global_unnamed_sometimes_linkonce` has the same issue too. I've added a FIXME for this
================
Comment at: lld/test/MachO/lto-internalize-unnamed-addr.ll:67
; LTO-DYLIB-DAG: (__DATA,__data) non-external _global_unnamed
+; LTO-DYLIB-DAG: (__DATA,__data) weak external _global_unnamed_sometimes_linkonce
; LTO-DYLIB-DAG: (__DATA,__data) weak external _local_unnamed
----------------
modimo wrote:
> Add final output binary check for LTO-DAG and THINLTO-DAG as well?
whoops, yeah. missed this
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D121428/new/
https://reviews.llvm.org/D121428
More information about the llvm-commits
mailing list