From 4b4fe385e49bd883fd183b5f21c1ea486c722e61 Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Sun, 24 Jul 2022 17:03:44 +0200 Subject: Vendor import of llvm-project main llvmorg-15-init-17485-ga3e38b4a206b. --- llvm/lib/Transforms/Utils/FunctionImportUtils.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'llvm/lib/Transforms/Utils/FunctionImportUtils.cpp') diff --git a/llvm/lib/Transforms/Utils/FunctionImportUtils.cpp b/llvm/lib/Transforms/Utils/FunctionImportUtils.cpp index 193806d9cc87..8e6d4626c9fd 100644 --- a/llvm/lib/Transforms/Utils/FunctionImportUtils.cpp +++ b/llvm/lib/Transforms/Utils/FunctionImportUtils.cpp @@ -35,6 +35,13 @@ bool FunctionImportGlobalProcessing::doImportAsDefinition( bool FunctionImportGlobalProcessing::shouldPromoteLocalToGlobal( const GlobalValue *SGV, ValueInfo VI) { assert(SGV->hasLocalLinkage()); + + // Ifuncs and ifunc alias does not have summary. + if (isa(SGV) || + (isa(SGV) && + isa(cast(SGV)->getAliaseeObject()))) + return false; + // Both the imported references and the original local variable must // be promoted. if (!isPerformingImport() && !isModuleExporting()) -- cgit v1.2.3