diff --git a/src/backend/jit/llvm/llvmjit_inline.cpp b/src/backend/jit/llvm/llvmjit_inline.cpp index 130e2ab415..b33a32141d 100644 --- a/src/backend/jit/llvm/llvmjit_inline.cpp +++ b/src/backend/jit/llvm/llvmjit_inline.cpp @@ -287,14 +287,6 @@ llvm_build_inline_plan(llvm::Module *mod) Assert(!funcDef->isDeclaration()); Assert(funcDef->hasExternalLinkage()); - /* don't inline functions marked as noinline */ - if (funcDef->getAttributes().hasFnAttribute(llvm::Attribute::NoInline)) - { - ilog(DEBUG1, "ineligibile to import %s due to noinline", - symbolName.data()); - continue; - } - llvm::StringSet<> importVars; llvm::SmallPtrSet visitedFunctions; int running_instcount = 0; @@ -600,6 +592,13 @@ function_inlinable(llvm::Function &F, if (F.materialize()) elog(FATAL, "failed to materialize metadata"); + if (F.getAttributes().hasFnAttribute(llvm::Attribute::NoInline)) + { + ilog(DEBUG1, "ineligibile to import %s due to noinline", + F.getName().data()); + return false; + } + function_references(F, running_instcount, referencedVars, referencedFunctions); for (llvm::GlobalVariable* rv: referencedVars)