[llvm-branch-commits] [llvm-branch] r269978 - Merging r257915:

Tom Stellard via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Wed May 18 13:32:40 PDT 2016


Author: tstellar
Date: Wed May 18 15:32:40 2016
New Revision: 269978

URL: http://llvm.org/viewvc/llvm-project?rev=269978&view=rev
Log:
Merging r257915:

------------------------------------------------------------------------
r257915 | rafael.espindola | 2016-01-15 10:23:46 -0800 (Fri, 15 Jan 2016) | 9 lines

Don't try to check all uses if lazy loading.

This means that LTO_SYMBOL_SCOPE_DEFAULT_CAN_BE_HIDDEN will not be set
in a few cases.

This should have no impact in ld64 since it doesn't use lazy loading
when merging modules and that is when it checks
LTO_SYMBOL_SCOPE_DEFAULT_CAN_BE_HIDDEN.

------------------------------------------------------------------------

Added:
    llvm/branches/release_38/test/LTO/X86/pr25919.ll
Modified:
    llvm/branches/release_38/lib/CodeGen/Analysis.cpp

Modified: llvm/branches/release_38/lib/CodeGen/Analysis.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/release_38/lib/CodeGen/Analysis.cpp?rev=269978&r1=269977&r2=269978&view=diff
==============================================================================
--- llvm/branches/release_38/lib/CodeGen/Analysis.cpp (original)
+++ llvm/branches/release_38/lib/CodeGen/Analysis.cpp Wed May 18 15:32:40 2016
@@ -639,6 +639,11 @@ bool llvm::canBeOmittedFromSymbolTable(c
   if (isa<GlobalAlias>(GV))
     return false;
 
+  // If we don't see every use, we have to be conservative and assume the value
+  // address is significant.
+  if (GV->getParent()->getMaterializer())
+    return false;
+
   GlobalStatus GS;
   if (GlobalStatus::analyzeGlobal(GV, GS))
     return false;

Added: llvm/branches/release_38/test/LTO/X86/pr25919.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/release_38/test/LTO/X86/pr25919.ll?rev=269978&view=auto
==============================================================================
--- llvm/branches/release_38/test/LTO/X86/pr25919.ll (added)
+++ llvm/branches/release_38/test/LTO/X86/pr25919.ll Wed May 18 15:32:40 2016
@@ -0,0 +1,11 @@
+; RUN: llvm-as < %s >%t1
+; RUN: llvm-lto -list-symbols-only %t1 | FileCheck %s
+
+; This tests that we don't crash trying to find all uses in a lazily loaded
+; module.
+; CHECK: foo
+
+target triple = "x86_64-unknown-linux-gnu"
+define linkonce_odr void @foo() {
+  ret void
+}




More information about the llvm-branch-commits mailing list