From df5e1e0e8bf4df75c338fb0488d353d00b8ef9d7 Mon Sep 17 00:00:00 2001 From: Eric Christopher Date: Fri, 9 Mar 2018 01:25:18 +0000 Subject: [PATCH] Revert "[ThinLTO] Keep available_externally symbols live" This reverts commit r327041 and the followup attempts at fixing the testcase as they're still failing. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@327094 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Transforms/IPO/FunctionImport.cpp | 22 +++------------------- test/ThinLTO/X86/deadstrip.ll | 9 --------- .../FunctionImport/Inputs/not-prevailing.ll | 6 ------ test/Transforms/FunctionImport/not-prevailing.ll | 19 ------------------- 4 files changed, 3 insertions(+), 53 deletions(-) delete mode 100644 test/Transforms/FunctionImport/Inputs/not-prevailing.ll delete mode 100644 test/Transforms/FunctionImport/not-prevailing.ll diff --git a/lib/Transforms/IPO/FunctionImport.cpp b/lib/Transforms/IPO/FunctionImport.cpp index c106f1105e7..b68058cbeea 100644 --- a/lib/Transforms/IPO/FunctionImport.cpp +++ b/lib/Transforms/IPO/FunctionImport.cpp @@ -544,25 +544,9 @@ void llvm::computeDeadSymbols( if (S->isLive()) return; - // We only keep live symbols that are known to be non-prevailing if any are - // available_externally. Those symbols are discarded later in the - // EliminateAvailableExternally pass and setting them to not-live breaks - // downstreams users of liveness information (PR36483). - if (isPrevailing(VI.getGUID()) == PrevailingType::No) { - bool AvailableExternally = false; - for (auto &S : VI.getSummaryList()) - if (S->linkage() == GlobalValue::AvailableExternallyLinkage) - AvailableExternally = true; - - if (!AvailableExternally) - return; - -#ifndef NDEBUG - for (auto &S : VI.getSummaryList()) - assert(!GlobalValue::isInterposableLinkage(S->linkage()) && - "Symbol with interposable and available_externally linkages"); -#endif - } + // We do not keep live symbols that are known to be non-prevailing. + if (isPrevailing(VI.getGUID()) == PrevailingType::No) + return; for (auto &S : VI.getSummaryList()) S->setLive(true); diff --git a/test/ThinLTO/X86/deadstrip.ll b/test/ThinLTO/X86/deadstrip.ll index 827ad225eda..e3f16a8e0b3 100644 --- a/test/ThinLTO/X86/deadstrip.ll +++ b/test/ThinLTO/X86/deadstrip.ll @@ -14,7 +14,6 @@ ; RUN: -r %t1.bc,_dead_func,pl \ ; RUN: -r %t1.bc,_baz,l \ ; RUN: -r %t1.bc,_boo,l \ -; RUN: -r %t1.bc,_live_available_externally_func,l \ ; RUN: -r %t2.bc,_baz,pl \ ; RUN: -r %t2.bc,_boo,pl \ ; RUN: -r %t2.bc,_dead_func,l \ @@ -28,8 +27,6 @@ ; COMBINED-DAG: &1 | FileCheck %s - -; CHECK: "Symbol with interposable and available_externally linkages" - -target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" -target triple = "x86_64-unknown-linux-gnu" - -define available_externally i32 @foo() { - ret i32 1 -} - -define i32 @bar() { - %1 = call i32 @foo() - ret i32 %1 -} -- 2.11.0