summaryrefslogtreecommitdiffstats
path: root/llvm
diff options
context:
space:
mode:
Diffstat (limited to 'llvm')
-rw-r--r--llvm/lib/Transforms/IPO/FunctionImport.cpp13
-rw-r--r--llvm/test/LTO/Resolution/X86/Inputs/dead-strip-alias.ll4
-rw-r--r--llvm/test/LTO/Resolution/X86/dead-strip-alias.ll20
3 files changed, 8 insertions, 29 deletions
diff --git a/llvm/lib/Transforms/IPO/FunctionImport.cpp b/llvm/lib/Transforms/IPO/FunctionImport.cpp
index b043687f898..da763b18d4d 100644
--- a/llvm/lib/Transforms/IPO/FunctionImport.cpp
+++ b/llvm/lib/Transforms/IPO/FunctionImport.cpp
@@ -488,14 +488,17 @@ void llvm::computeDeadSymbols(
while (!Worklist.empty()) {
auto VI = Worklist.pop_back_val();
for (auto &Summary : VI.getSummaryList()) {
- GlobalValueSummary *Base = Summary.get();
- if (auto *AS = dyn_cast<AliasSummary>(Base))
- Base = &AS->getAliasee();
- for (auto Ref : Base->refs())
+ for (auto Ref : Summary->refs())
visit(Ref);
- if (auto *FS = dyn_cast<FunctionSummary>(Base))
+ if (auto *FS = dyn_cast<FunctionSummary>(Summary.get()))
for (auto Call : FS->calls())
visit(Call.first);
+ if (auto *AS = dyn_cast<AliasSummary>(Summary.get())) {
+ auto AliaseeGUID = AS->getAliasee().getOriginalName();
+ ValueInfo AliaseeVI = Index.getValueInfo(AliaseeGUID);
+ if (AliaseeVI)
+ visit(AliaseeVI);
+ }
}
}
Index.setWithGlobalValueDeadStripping();
diff --git a/llvm/test/LTO/Resolution/X86/Inputs/dead-strip-alias.ll b/llvm/test/LTO/Resolution/X86/Inputs/dead-strip-alias.ll
deleted file mode 100644
index 16154d2c45b..00000000000
--- a/llvm/test/LTO/Resolution/X86/Inputs/dead-strip-alias.ll
+++ /dev/null
@@ -1,4 +0,0 @@
-target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
-target triple = "x86_64-unknown-linux-gnu"
-
-@external = global i8 42
diff --git a/llvm/test/LTO/Resolution/X86/dead-strip-alias.ll b/llvm/test/LTO/Resolution/X86/dead-strip-alias.ll
deleted file mode 100644
index d009a484e4f..00000000000
--- a/llvm/test/LTO/Resolution/X86/dead-strip-alias.ll
+++ /dev/null
@@ -1,20 +0,0 @@
-; RUN: opt -module-summary -o %t %s
-; RUN: opt -module-summary -o %t2 %S/Inputs/dead-strip-alias.ll
-; RUN: llvm-lto2 run %t -r %t,main,px -r %t,alias,p -r %t,external, \
-; RUN: %t2 -r %t2,external,p \
-; RUN: -save-temps -o %t3
-; RUN: llvm-nm %t3.1 | FileCheck %s
-
-; CHECK: D external
-
-target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
-target triple = "x86_64-unknown-linux-gnu"
-
-@alias = alias i8*, i8** @internal
-
-@internal = internal global i8* @external
-@external = external global i8
-
-define i8** @main() {
- ret i8** @alias
-}
OpenPOWER on IntegriCloud