[GlobalDCE] AvailableExternal linkage is checked in isDiscardableIfUnused [NFC].
authorXin Tong <trent.xin.tong@gmail.com>
Thu, 20 Sep 2018 21:16:16 +0000 (21:16 +0000)
committerXin Tong <trent.xin.tong@gmail.com>
Thu, 20 Sep 2018 21:16:16 +0000 (21:16 +0000)
Summary:
AvailableExternal was not handled in isDiscardableIfUnused when isDiscardableIfUnused
was added in r158476. Till it was handled in r247044. This is a NFC.

Reviewers: pcc, tejohnson

Reviewed By: tejohnson

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D52319

llvm-svn: 342684

llvm/lib/Transforms/IPO/GlobalDCE.cpp

index ada9eb8..c77ea04 100644 (file)
@@ -165,7 +165,7 @@ PreservedAnalyses GlobalDCEPass::run(Module &M, ModuleAnalysisManager &MAM) {
     // Functions with external linkage are needed if they have a body.
     // Externally visible & appending globals are needed, if they have an
     // initializer.
-    if (!GO.isDeclaration() && !GO.hasAvailableExternallyLinkage())
+    if (!GO.isDeclaration())
       if (!GO.isDiscardableIfUnused())
         MarkLive(GO);