summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric Christopher <echristo@gmail.com>2018-03-09 01:25:18 +0000
committerEric Christopher <echristo@gmail.com>2018-03-09 01:25:18 +0000
commit3caa0fd05099bba12f5630c3f2eeceec9a799eec (patch)
tree3a034b77a46f96d91964c044c19400bafaef9369
parent784f1bbf5e51d041f2ea811a2d593e8dfad3033f (diff)
downloadbcm5719-llvm-3caa0fd05099bba12f5630c3f2eeceec9a799eec.tar.gz
bcm5719-llvm-3caa0fd05099bba12f5630c3f2eeceec9a799eec.zip
Revert "[ThinLTO] Keep available_externally symbols live"
This reverts commit r327041 and the followup attempts at fixing the testcase as they're still failing. llvm-svn: 327094
-rw-r--r--llvm/lib/Transforms/IPO/FunctionImport.cpp22
-rw-r--r--llvm/test/ThinLTO/X86/deadstrip.ll9
-rw-r--r--llvm/test/Transforms/FunctionImport/Inputs/not-prevailing.ll6
-rw-r--r--llvm/test/Transforms/FunctionImport/not-prevailing.ll19
4 files changed, 3 insertions, 53 deletions
diff --git a/llvm/lib/Transforms/IPO/FunctionImport.cpp b/llvm/lib/Transforms/IPO/FunctionImport.cpp
index c106f1105e7..b68058cbeea 100644
--- a/llvm/lib/Transforms/IPO/FunctionImport.cpp
+++ b/llvm/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/llvm/test/ThinLTO/X86/deadstrip.ll b/llvm/test/ThinLTO/X86/deadstrip.ll
index 827ad225eda..e3f16a8e0b3 100644
--- a/llvm/test/ThinLTO/X86/deadstrip.ll
+++ b/llvm/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: <COMBINED {{.*}} op2=119
; Live, dso_local, Internal
; COMBINED-DAG: <COMBINED {{.*}} op2=103
-; Live, Local, AvailableExternally
-; COMBINED-DAG: <COMBINED {{.*}} op2=97
; Live, Local, External
; COMBINED-DAG: <COMBINED {{.*}} op2=96
; COMBINED-DAG: <COMBINED {{.*}} op2=96
@@ -82,7 +79,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 %t3.bc,_baz,pl \
; RUN: -r %t3.bc,_boo,pl \
; RUN: -r %t3.bc,_dead_func,l \
@@ -128,13 +124,8 @@ define void @dead_func() {
ret void
}
-define available_externally void @live_available_externally_func() {
- ret void
-}
-
define void @main() {
call void @bar()
call void @bar_internal()
- call void @live_available_externally_func()
ret void
}
diff --git a/llvm/test/Transforms/FunctionImport/Inputs/not-prevailing.ll b/llvm/test/Transforms/FunctionImport/Inputs/not-prevailing.ll
deleted file mode 100644
index ca17d7f377c..00000000000
--- a/llvm/test/Transforms/FunctionImport/Inputs/not-prevailing.ll
+++ /dev/null
@@ -1,6 +0,0 @@
-target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
-target triple = "x86_64-unknown-linux-gnu"
-
-define weak i32 @foo() {
- ret i32 0
-}
diff --git a/llvm/test/Transforms/FunctionImport/not-prevailing.ll b/llvm/test/Transforms/FunctionImport/not-prevailing.ll
deleted file mode 100644
index e9f9f7d525b..00000000000
--- a/llvm/test/Transforms/FunctionImport/not-prevailing.ll
+++ /dev/null
@@ -1,19 +0,0 @@
-; REQUIRES: asserts
-; RUN: opt -module-summary %s -o %t1.bc
-; RUN: opt -module-summary -o %t2.bc %S/Inputs/not-prevailing.ll
-; RUN: not --crash llvm-lto2 run -o %t3.bc %t1.bc %t2.bc -r %t1.bc,bar,px \
-; RUN: -r %t1.bc,foo,x -r %t2.bc,foo,x -save-temps 2>&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
-}
OpenPOWER on IntegriCloud