Skip to content
Snippets Groups Projects
Commit da267435 authored by Axel Naumann's avatar Axel Naumann
Browse files

[cling] JIT: only re-use *large* existing weak functions:

Small functions might get inlined, and hiding their definition prevents
the inliner from doing its job.
parent 23ca9fe5
No related branches found
No related tags found
No related merge requests found
......@@ -267,6 +267,15 @@ namespace {
// GV is a definition.
if (auto *Func = dyn_cast<Function>(&GV))
if (Func->getInstructionCount() < 50) {
// This is a small function. Keep its definition to retain it for
// inlining: the cost for JITting it is small, and the likelihood
// that the call will be inlined is high.
return false;
}
llvm::GlobalValue::LinkageTypes LT = GV.getLinkage();
if (!GV.isDiscardableIfUnused(LT) || !GV.isWeakForLinker(LT))
return false;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment