Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fast-Path String and Vector Hash Code Methods on Power #21081

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
18 changes: 4 additions & 14 deletions runtime/compiler/optimizer/InlinerTempForJ9.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5575,26 +5575,16 @@ TR_J9InlinerPolicy::supressInliningRecognizedInitialCallee(TR_CallSite* callsite
case TR::java_lang_Class_cast:
return true; // Call will be transformed into checkcast
case TR::java_lang_String_hashCodeImplDecompressed:
/*
* X86 and z want to avoid inlining both java_lang_String_hashCodeImplDecompressed and java_lang_String_hashCodeImplCompressed
* so they can be recognized and replaced with a custom fast implementation.
* Power currently only has the custom fast implementation for java_lang_String_hashCodeImplDecompressed.
* As a result, Power only wants to prevent inlining of java_lang_String_hashCodeImplDecompressed.
* When Power gets a fast implementation of TR::java_lang_String_hashCodeImplCompressed, this case can be merged into the case
* for java_lang_String_hashCodeImplCompressed instead of using a fallthrough.
*/
if (!TR::Compiler->om.canGenerateArraylets() && !TR::Compiler->om.isOffHeapAllocationEnabled() &&
comp->target().cpu.isPower() && comp->target().cpu.isAtLeast(OMR_PROCESSOR_PPC_P8) && comp->target().cpu.supportsFeature(OMR_FEATURE_PPC_HAS_VSX) && !comp->compileRelocatableCode())
{
return true;
}
// Intentional fallthrough here.
case TR::java_lang_String_hashCodeImplCompressed:
// X86, Z and Power have custom fast implementations for these 2 methods
// so their inlining should be avoided.
{
if (comp->cg()->getSupportsInlineStringHashCode())
{
return true;
}
break;
}
case TR::jdk_internal_util_ArraysSupport_vectorizedHashCode:
{
if (comp->cg()->getSupportsInlineVectorizedHashCode())
Expand Down
14 changes: 14 additions & 0 deletions runtime/compiler/p/codegen/J9CodeGenerator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,20 @@ J9::Power::CodeGenerator::initialize()
if (!comp->getOption(TR_DisableReadMonitors))
cg->setSupportsReadOnlyLocks();

if (!TR::Compiler->om.canGenerateArraylets()
&& !TR::Compiler->om.isOffHeapAllocationEnabled()
&& comp->target().cpu.isAtLeast(OMR_PROCESSOR_PPC_P8)
&& comp->target().cpu.supportsFeature(OMR_FEATURE_PPC_HAS_VSX)
&& !comp->compileRelocatableCode()
#ifdef J9VM_OPT_JITSERVER
&& !comp->isOutOfProcessCompilation()
#endif
)
{
cg->setSupportsInlineStringHashCode();
cg->setSupportsInlineVectorizedHashCode();
}

static bool disableTLHPrefetch = (feGetEnv("TR_DisableTLHPrefetch") != NULL);

// Enable software prefetch of the TLH and configure the TLH prefetching
Expand Down
Loading