[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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@350939 91177308-0d34-0410-b5e6-96231b3b80d8
2 files changed