[MergeFunc] Erase unused duplicate functions if they are discardable
authorVedant Kumar <vsk@apple.com>
Fri, 11 Jan 2019 17:56:35 +0000 (17:56 +0000)
committerVedant Kumar <vsk@apple.com>
Fri, 11 Jan 2019 17:56:35 +0000 (17:56 +0000)
commitee10ef737e58409d1c34c68ad17b568e8a50120f
tree8e643539dfe36331c633f151b3f3b0af039cdd6f
parent08fe7e02fba6206c196d5e8527f8b40bb17941ad
[MergeFunc] Erase unused duplicate functions if they are discardable

MergeFunc only deletes unused duplicate functions if they have local
linkage, but it should be safe to relax this to any "discardable if
unused" linkage type.

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

llvm-svn: 350939
llvm/lib/Transforms/IPO/MergeFunctions.cpp
llvm/test/Transforms/MergeFunc/linkonce_odr.ll