diff options
author | Mehdi Amini <mehdi.amini@apple.com> | 2016-05-03 00:27:28 +0000 |
---|---|---|
committer | Mehdi Amini <mehdi.amini@apple.com> | 2016-05-03 00:27:28 +0000 |
commit | 5b85d8d67b28f082db53863a922895211a01baa2 (patch) | |
tree | 439413643e4744cf4ba7a2ba178e6de3bcff7242 /llvm/lib/Transforms/IPO/FunctionImport.cpp | |
parent | d1aabb28134a7e72ce4d6ac26b093648f5c57e88 (diff) | |
download | bcm5719-llvm-5b85d8d67b28f082db53863a922895211a01baa2.tar.gz bcm5719-llvm-5b85d8d67b28f082db53863a922895211a01baa2.zip |
ThinLTO: do not import function whose linkage prevents inlining.
There is not point in importing a "weak" or a "linkonce" function
since we won't be able to inline it anyway.
We already had a targeted check for WeakAny, this is using the
same check on GlobalValue as the inline, i.e.
isMayBeOverriddenLinkage()
From: Mehdi Amini <mehdi.amini@apple.com>
llvm-svn: 268341
Diffstat (limited to 'llvm/lib/Transforms/IPO/FunctionImport.cpp')
-rw-r--r-- | llvm/lib/Transforms/IPO/FunctionImport.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/IPO/FunctionImport.cpp b/llvm/lib/Transforms/IPO/FunctionImport.cpp index ec82248d78b..d9860a908d0 100644 --- a/llvm/lib/Transforms/IPO/FunctionImport.cpp +++ b/llvm/lib/Transforms/IPO/FunctionImport.cpp @@ -156,8 +156,8 @@ selectCallee(const ModuleSummaryIndex &Index, CalleeSummaryList, [&](const std::unique_ptr<GlobalValueSummary> &SummaryPtr) { auto *GVSummary = SummaryPtr.get(); - if (GlobalValue::isWeakAnyLinkage(GVSummary->linkage())) - // There is no point in importing weak symbols, we can't inline them + if (GlobalValue::isMayBeOverriddenLinkage(GVSummary->linkage())) + // There is no point in importing these, we can't inline them return false; if (auto *AS = dyn_cast<AliasSummary>(GVSummary)) { GVSummary = &AS->getAliasee(); |