Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 1 addition & 1 deletion runtime/compiler/control/J9Options.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ int32_t J9::Options::_maxIprofilingCount = TR_DEFAULT_INITIAL_COUNT; // 3000
int32_t J9::Options::_maxIprofilingCountInStartupMode = TR_QUICKSTART_INITIAL_COUNT; // 1000
int32_t J9::Options::_iprofilerFailRateThreshold = 70; // percent 1-100
int32_t J9::Options::_iprofilerFailHistorySize = 10; // percent 1-100
int32_t J9::Options::_iprofilerFaninMethodMinSize = 50; // bytecodes
int32_t J9::Options::_iprofilerFaninMethodMinSize = 30; // bytecodes

int32_t J9::Options::_compYieldStatsThreshold = 1000; // usec
int32_t J9::Options::_compYieldStatsHeartbeatPeriod = 0; // ms
Expand Down
3 changes: 2 additions & 1 deletion runtime/compiler/optimizer/InlinerTempForJ9.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2971,7 +2971,8 @@ TR_J9InlinerPolicy::adjustFanInSizeInWeighCallSite(int32_t& weight,

INLINE_fanInCallGraphFactor is an integer number divided by 100. This allows us to avoid using float numbers for specifying the factor.
*/
if (comp()->getMethodHotness() > warm)
static bool disableFanInAtHighOpt = feGetEnv("TR_disableFanInAtHighOpt") != NULL;
if (disableFanInAtHighOpt && comp()->getMethodHotness() > warm)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was || intended instead of && here? I would have expected that the behavior (when TR_disableFanInAtHighOpt is not present) would not change.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We do want to change the default behaviour and revert to the old behaviour when the env var is set.

The env var isn't there to control the fan-in heuristic in general (that can be done via -Xjit), it's there to quickly revert just this part of the change in case it causes perf regressions or functional issues in the near future. Thanks for double checking it.

Copy link
Contributor

@keithc-ca keithc-ca Nov 6, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But when the environment variable is not set, disableFanInAtHighOpt == false and the if condition is false.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, that causes control to skip the return and execute the rest of the routine as intended.

Before:

  • Methods compiled at <=warm don't return here and execute the rest of the routine, and are thereby subject to the fan-in heuristic.
  • Methods compiled at >warm return here and aren't subjected to fan-in heuristic.

After:

  • By default no methods return here, they all execute the rest of the routine and are subjected to the fan-in heuristic.
  • If the env var is set, methods compiled at >warm return, are not subject to fan-in; methods <=warm don't return, are subject to fan-in as before.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@keithc-ca That is intentional from my understanding. Now at higher opts, unless TR_disableFanInAtHighOpt is set, we do not do an early return from the method adjustFanInSizeInWeighCallSite. The behaviour prior to this change was that at opt levels > warm, adjustFanInSizeInWeighCallSite was disabled. This PR now allows things to proceed at higher opt levels, with the option to disable it at higher opt levels.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, thanks for the explanations.

return;

uint32_t thresholdSize = (!comp()->getOption(TR_InlinerFanInUseCalculatedSize)) ? getJ9InitialBytecodeSize(callee, 0, comp()) : size;
Expand Down