Skip to content

Commit 24f5138

Browse files
authored
Merge pull request #21001 from mpirvu/inline-fanin-fix
Adjust inliner use of profiled fanin data
2 parents 7cf1352 + c58b321 commit 24f5138

File tree

1 file changed

+15
-6
lines changed

1 file changed

+15
-6
lines changed

runtime/compiler/optimizer/InlinerTempForJ9.cpp

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4722,13 +4722,22 @@ bool TR_MultipleCallTargetInliner::isLargeCompiledMethod(TR_ResolvedMethod *call
47224722
veryLargeCompiledMethodFaninThreshold = 0;
47234723
}
47244724
}
4725-
4726-
uint32_t numCallers = 0, totalWeight = 0;
4727-
((TR_ResolvedJ9Method *) calleeResolvedMethod)->getFaninInfo(&numCallers, &totalWeight);
4728-
if ((numCallers > veryLargeCompiledMethodFaninThreshold) &&
4729-
(bytecodeSize > veryLargeCompiledMethodThreshold))
4725+
// Prevent inlining of "large" methods with "many" callers
4726+
if (bytecodeSize > veryLargeCompiledMethodThreshold)
47304727
{
4731-
return true;
4728+
uint32_t numCallers = 0, totalWeight = 0;
4729+
if (!comp()->getOption(TR_DisableInlinerFanIn))
4730+
((TR_ResolvedJ9Method *) calleeResolvedMethod)->getFaninInfo(&numCallers, &totalWeight);
4731+
if (numCallers == 0) // no fanin info
4732+
{
4733+
// If there is no fanin info, prevent inlining just based on method size
4734+
return true;
4735+
}
4736+
else
4737+
{
4738+
if (numCallers > veryLargeCompiledMethodFaninThreshold)
4739+
return true;
4740+
}
47324741
}
47334742
}
47344743
}

0 commit comments

Comments
 (0)