[PATCH] D49777: [LTO] Don't internalize declarations

Peter Collingbourne via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 26 13:16:51 PDT 2018


pcc added inline comments.


================
Comment at: llvm/lib/LTO/LTO.cpp:874
           RegularLTO.CombinedModule->getNamedValue(R.second.IRName);
-      // Ignore symbols defined in other partitions.
-      if (!GV || GV->hasLocalLinkage())
+      // Ignore declarations and symbols defined in other partitions.
+      if (!GV || GV->hasLocalLinkage() || GV->isDeclaration())
----------------
I would explain in the comment why we are ignoring declarations here.


================
Comment at: llvm/test/LTO/X86/pr38046.ll:20
+define i32 @foo() !dbg !17 {
+  call void @llvm.dbg.value(metadata i32 ()* @get, metadata !22, metadata !DIExpression()), !dbg !24
+  ret i32 0, !dbg !25
----------------
If this just needs to be an `llvm.dbg.value` referring to `get` I think this can still be made simpler. See `llvm/test/CodeGen/Generic/dbg_value.ll` which appears to be the smallest test case in the tree that uses `llvm.dbg.value`.


https://reviews.llvm.org/D49777





More information about the llvm-commits mailing list