[llvm] r275277 - [ThinLTO/gold] Enable symbol resolution in distributed backend case

Teresa Johnson via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 13 09:35:56 PDT 2016


Author: tejohnson
Date: Wed Jul 13 11:35:56 2016
New Revision: 275277

URL: http://llvm.org/viewvc/llvm-project?rev=275277&view=rev
Log:
[ThinLTO/gold] Enable symbol resolution in distributed backend case

While testing a follow-on change to enable index-based symbol resolution
and internalization in the distributed backends, I realized that a test
case change I made in r275247 was only required because we were not
analyzing symbols in the claimed files in thinlto-index-only mode.

In the fixed test case there should be no internalization because we are
linking in -shared mode, so f() is in fact exported, which is detected
properly when we analyze symbols in thinlto-index-only mode. Note that
this is not (yet) a correctness issue (because we are not yet performing
the index-based linkage optimizations in the distributed backends -
that's coming in a follow-on patch).

Modified:
    llvm/trunk/test/tools/gold/X86/thinlto.ll
    llvm/trunk/tools/gold/gold-plugin.cpp

Modified: llvm/trunk/test/tools/gold/X86/thinlto.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/gold/X86/thinlto.ll?rev=275277&r1=275276&r2=275277&view=diff
==============================================================================
--- llvm/trunk/test/tools/gold/X86/thinlto.ll (original)
+++ llvm/trunk/test/tools/gold/X86/thinlto.ll Wed Jul 13 11:35:56 2016
@@ -62,8 +62,6 @@
 ; BACKEND1-NEXT: </MODULE_STRTAB_BLOCK
 ; BACKEND1-NEXT: <GLOBALVAL_SUMMARY_BLOCK
 ; BACKEND1-NEXT: <VERSION
-; One of these will be a COMBINED_ORIGINAL_NAME since f can be internalized.
-; BACKEND1-NEXT: <COMBINED
 ; BACKEND1-NEXT: <COMBINED
 ; BACKEND1-NEXT: <COMBINED
 ; BACKEND1-NEXT: </GLOBALVAL_SUMMARY_BLOCK

Modified: llvm/trunk/tools/gold/gold-plugin.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/gold/gold-plugin.cpp?rev=275277&r1=275276&r2=275277&view=diff
==============================================================================
--- llvm/trunk/tools/gold/gold-plugin.cpp (original)
+++ llvm/trunk/tools/gold/gold-plugin.cpp Wed Jul 13 11:35:56 2016
@@ -524,11 +524,6 @@ static ld_plugin_status claim_file_hook(
     cf.name += ".llvm." + std::to_string(file->offset) + "." +
                sys::path::filename(Obj->getModule().getSourceFileName()).str();
 
-  // If we are doing ThinLTO compilation, don't need to process the symbols.
-  // Later we simply build a combined index file after all files are claimed.
-  if (options::thinlto && options::thinlto_index_only)
-    return LDPS_OK;
-
   for (auto &Sym : Obj->symbols()) {
     uint32_t Symflags = Sym.getFlags();
     if (shouldSkip(Symflags))




More information about the llvm-commits mailing list