[PATCH] D135427: [ThinLTO] Make local linkage GlobalValue in non-prevailing comdat available_externally

Teresa Johnson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 7 08:41:17 PDT 2022


tejohnson added a comment.

> Regular LTO is not fixed yet.

Looks like handleNonPrevailingComdat in LTO.cpp would need a similar fix.

> When FuncImport.cpp ...

Note that while this functionality currently lives in FunctionImport.cpp it isn't really related to function importing, rather to ThinLTO symbol resolution. So mentioning the file name might be a little misleading (but if you do, correct it to FunctionImport.cpp).

@xur can you confirm this fixes the original problem?



================
Comment at: llvm/test/ThinLTO/X86/linkonce_resolution_comdat.ll:22
+; IMPORT2: define available_externally i32 @g() unnamed_addr [[ATTR]] {
+; IMPORT2: define available_externally dso_local void @g_internal() unnamed_addr {
 
----------------
I assume the rest of the cases above (i.e. besides g_internal) already worked before this patch, including g_private since it is not local (see question about this below), is that correct?


================
Comment at: llvm/test/ThinLTO/X86/linkonce_resolution_comdat.ll:42
 
-define linkonce_odr i32 @f(i8*) unnamed_addr comdat($c1) {
+ at g_private = global i32 43, comdat($g)
+
----------------
Was this meant to have private linkage?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D135427/new/

https://reviews.llvm.org/D135427



More information about the llvm-commits mailing list