Skip to content

Commit

Permalink
Enable arraycmp and arraycmplen uniformly
Browse files Browse the repository at this point in the history
For all platforms where arraycmp and arraycmplen are supported, do not
set the corresponding support flags in the code generator when either
- arraylets can be generated
- the TR_DisableArrayCmp(Len) environment variable is set

Signed-off-by: Spencer Comin <[email protected]>
  • Loading branch information
Spencer-Comin committed Sep 7, 2023
1 parent f8fecbe commit 9b37a68
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 9 deletions.
4 changes: 2 additions & 2 deletions compiler/aarch64/codegen/OMRCodeGenerator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -179,12 +179,12 @@ OMR::ARM64::CodeGenerator::initialize()
cg->setSupportsCompactedLocals();
if (!TR::Compiler->om.canGenerateArraylets())
{
static const bool disableArrayCmp = feGetEnv("TR_aarch64DisableArrayCmp") != NULL;
static const bool disableArrayCmp = feGetEnv("TR_DisableArrayCmp") != NULL;
if (!disableArrayCmp)
{
cg->setSupportsArrayCmp();
}
static const bool disableArrayCmpLen = feGetEnv("TR_aarch64DisableArrayCmpLen") != NULL;
static const bool disableArrayCmpLen = feGetEnv("TR_DisableArrayCmpLen") != NULL;
if (!disableArrayCmpLen)
{
cg->setSupportsArrayCmpLen();
Expand Down
16 changes: 14 additions & 2 deletions compiler/p/codegen/OMRCodeGenerator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -225,8 +225,20 @@ OMR::Power::CodeGenerator::initialize()
{
cg->setSupportsArraySet();
}
cg->setSupportsArrayCmp();
cg->setSupportsArrayCmpLen();

if (!TR::Compiler->om.canGenerateArraylets())
{
static const bool disableArrayCmp = feGetEnv("TR_DisableArrayCmp") != NULL;
if (!disableArrayCmp)
{
cg->setSupportsArrayCmp();
}
static const bool disableArrayCmpLen = feGetEnv("TR_DisableArrayCmpLen") != NULL;
if (!disableArrayCmpLen)
{
cg->setSupportsArrayCmpLen();
}
}

if (comp->target().cpu.supportsFeature(OMR_FEATURE_PPC_HAS_VSX))
{
Expand Down
12 changes: 10 additions & 2 deletions compiler/x/codegen/OMRCodeGenerator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -379,8 +379,16 @@ OMR::X86::CodeGenerator::initializeX86(TR::Compilation *comp)

if (!TR::Compiler->om.canGenerateArraylets())
{
self()->setSupportsArrayCmp();
self()->setSupportsArrayCmpLen();
static const bool disableArrayCmp = feGetEnv("TR_DisableArrayCmp") != NULL;
if (!disableArrayCmp)
{
self()->setSupportsArrayCmp();
}
static const bool disableArrayCmpLen = feGetEnv("TR_DisableArrayCmpLen") != NULL;
if (!disableArrayCmpLen)
{
self()->setSupportsArrayCmpLen();
}
self()->setSupportsPrimitiveArrayCopy();
if (!comp->getOption(TR_DisableArraySetOpts))
{
Expand Down
17 changes: 14 additions & 3 deletions compiler/z/codegen/OMRCodeGenerator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -502,9 +502,20 @@ OMR::Z::CodeGenerator::initialize()
{
cg->setSupportsArraySet();
}
cg->setSupportsArrayCmp();
cg->setSupportsArrayCmpLen();
cg->setSupportsArrayCmpSign();
if (!TR::Compiler->om.canGenerateArraylets())
{
static const bool disableArrayCmp = feGetEnv("TR_DisableArrayCmp") != NULL;
if (!disableArrayCmp)
{
cg->setSupportsArrayCmp();
cg->setSupportsArrayCmpSign();
}
static const bool disableArrayCmpLen = feGetEnv("TR_DisableArrayCmpLen") != NULL;
if (!disableArrayCmpLen)
{
cg->setSupportsArrayCmpLen();
}
}
if (!comp->compileRelocatableCode())
{
cg->setSupportsArrayTranslateTRxx();
Expand Down

0 comments on commit 9b37a68

Please sign in to comment.