For MSVC weak symbols, re-use even small funcs:

Without, the JIT fails to compile roottest/root/aclic/misc/assertROOT7027.C
correctly.
This commit is contained in:
Axel Naumann 2023-01-17 12:56:34 +01:00 committed by jenkins
parent 8a87d1f8d6
commit feb0db382e

View File

@ -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!