[PATCH] D135427: [LTO] 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 21:54:53 PDT 2022


tejohnson added inline comments.


================
Comment at: llvm/lib/Transforms/IPO/FunctionImport.cpp:1148
+  // FinalizeInModule has handled non-local-linkage GlobalValues. Here we handle
+  // local linkage GlobalValues.
+  if (NonPrevailingComdats.empty())
----------------
maybe add assert below that anything we find has local linkage.


================
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)
+
----------------
MaskRay wrote:
> tejohnson wrote:
> > Was this meant to have private linkage?
> `g` (comdat key) is meant to have private linkage. A comdat with a local linkage key should not be used for portability.
Sorry, not following. How/when does g_private get private linkage? Because it is external here afaict.


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