Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
[cling] For MSVC weak symbols, re-use even small funcs:
Without, the JIT fails to compile roottest/root/aclic/misc/assertROOT7027.C
correctly.
  • Loading branch information
Axel-Naumann committed Jan 17, 2023
commit 42e9bdf3b0201a6a8f63e3e0c1dfee31f449808d
4 changes: 3 additions & 1 deletion interpreter/cling/lib/Interpreter/BackendPasses.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -298,13 +298,15 @@ namespace {
bool runOnFunc(Function& Func) {
if (Func.isDeclaration())
return false; // no change.

#ifndef _WIN32
// MSVC's stdlib gets symbol issues; i.e. apparently: JIT all or none.
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;
}
#endif
if (shouldRemoveGlobalDefinition(Func)) {
Func.deleteBody(); // make this a declaration
return true; // a change!
Expand Down