Skip to content

Commit fd2a987

Browse files
authored
Merge pull request #20052 from mpirvu/tlhfix-0.48.0
(0.48.0) Disable TLH prefetching for portable AOT code
2 parents fb38bda + 47fd184 commit fd2a987

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

runtime/compiler/control/J9Options.cpp

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2179,15 +2179,21 @@ void J9::Options::preProcessTLHPrefetch(J9JavaVM *vm)
21792179
#elif defined(TR_HOST_ARM64)
21802180
preferTLHPrefetch = true;
21812181
#else // TR_HOST_X86
2182-
preferTLHPrefetch =
2183-
(TR::Compiler->target.cpu.isGenuineIntel() &&
2184-
TR::Compiler->target.cpu.isAtMost(OMR_PROCESSOR_X86_INTEL_BROADWELL)) ||
2185-
!TR::Compiler->target.cpu.isGenuineIntel();
2182+
preferTLHPrefetch = !TR::Compiler->target.cpu.isGenuineIntel() ||
2183+
TR::Compiler->target.cpu.isAtMost(OMR_PROCESSOR_X86_INTEL_BROADWELL);
21862184

21872185
// Disable TM on x86 because we cannot tell whether a Haswell chip supports
21882186
// TM or not, plus it's killing the performance on dayTrader3
21892187
self()->setOption(TR_DisableTM);
21902188
#endif
2189+
// For portable AOT code we want to disable TLH prefetch
2190+
if (preferTLHPrefetch &&
2191+
J9_ARE_ANY_BITS_SET(vm->extendedRuntimeFlags2, J9_EXTENDED_RUNTIME2_ENABLE_PORTABLE_SHARED_CACHE) &&
2192+
self() == TR::Options::getAOTCmdLineOptions()
2193+
)
2194+
{
2195+
preferTLHPrefetch = false;
2196+
}
21912197

21922198
IDATA notlhPrefetch = FIND_ARG_IN_VMARGS(EXACT_MATCH, J9::Options::_externalOptionStrings[J9::ExternalOptions::XnotlhPrefetch], 0);
21932199
IDATA tlhPrefetch = FIND_ARG_IN_VMARGS(EXACT_MATCH, J9::Options::_externalOptionStrings[J9::ExternalOptions::XtlhPrefetch], 0);

runtime/compiler/runtime/RelocationRuntime.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -938,7 +938,7 @@ TR_RelocationRuntime::generateFeatureFlags(TR_FrontEnd *fe)
938938
if (TR::Options::getCmdLineOptions()->getOption(TR_DisableTraps))
939939
featureFlags |= TR_FeatureFlag_DisableTraps;
940940

941-
if (TR::Options::getCmdLineOptions()->getOption(TR_TLHPrefetch))
941+
if (TR::Options::getAOTCmdLineOptions()->getOption(TR_TLHPrefetch))
942942
featureFlags |= TR_FeatureFlag_TLHPrefetch;
943943

944944
if (TR::CodeCacheManager::instance()->codeCacheConfig().needsMethodTrampolines())

0 commit comments

Comments
 (0)