mirror of
https://git.postgresql.org/git/postgresql.git
synced 2025-01-12 18:34:36 +08:00
LLVMJIT: Check for 'noinline' attribute in recursively inlined functions.
Previously the attribute was only checked for external functions inlined, not "static" functions that had to be inlined as dependencies. This isn't really a bug, but makes debugging a bit harder. The new behaviour also makes more sense. Therefore backpatch. Author: Andres Freund Backpatch: 11-, where JIT compilation was added
This commit is contained in:
parent
167075be3a
commit
bcafa263ec
@ -287,14 +287,6 @@ llvm_build_inline_plan(llvm::Module *mod)
|
|||||||
Assert(!funcDef->isDeclaration());
|
Assert(!funcDef->isDeclaration());
|
||||||
Assert(funcDef->hasExternalLinkage());
|
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::StringSet<> importVars;
|
||||||
llvm::SmallPtrSet<const llvm::Function *, 8> visitedFunctions;
|
llvm::SmallPtrSet<const llvm::Function *, 8> visitedFunctions;
|
||||||
int running_instcount = 0;
|
int running_instcount = 0;
|
||||||
@ -600,6 +592,13 @@ function_inlinable(llvm::Function &F,
|
|||||||
if (F.materialize())
|
if (F.materialize())
|
||||||
elog(FATAL, "failed to materialize metadata");
|
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);
|
function_references(F, running_instcount, referencedVars, referencedFunctions);
|
||||||
|
|
||||||
for (llvm::GlobalVariable* rv: referencedVars)
|
for (llvm::GlobalVariable* rv: referencedVars)
|
||||||
|
Loading…
Reference in New Issue
Block a user