Skip to content

Commit

Permalink
Deprecate TR_OptimizeForSpace
Browse files Browse the repository at this point in the history
This option is not set anywhere and there is no option flag present
which can enable this option. Therefore the code guarded by it is
dead.
  • Loading branch information
fjeremic committed May 5, 2021
1 parent d96f2b3 commit 20d6734
Show file tree
Hide file tree
Showing 8 changed files with 11 additions and 25 deletions.
6 changes: 2 additions & 4 deletions compiler/arm/codegen/ControlFlowEvaluator.cpp
Expand Up @@ -127,8 +127,7 @@ static TR::Instruction *compareIntsForOrder(TR_ARMConditionCode branchType,
bool cannotInline = false;

// For TR::instanceof, the opcode must be ificmpeq/ne.
if (!cg->comp()->getOption(TR_OptimizeForSpace) &&
firstChild->getOpCodeValue() == TR::instanceof &&
if (firstChild->getOpCodeValue() == TR::instanceof &&
firstChild->getRegister() == NULL &&
node->getReferenceCount() <=1 &&
(value == 0 || value == 1))
Expand Down Expand Up @@ -235,8 +234,7 @@ TR::Instruction *OMR::ARM::TreeEvaluator::compareIntsForEquality(TR_ARMCondition
bool cannotInline = false;

// For TR::instanceof, the opcode must be ificmpeq/ne.
if (!cg->comp()->getOption(TR_OptimizeForSpace) &&
firstChild->getOpCodeValue() == TR::instanceof &&
if (firstChild->getOpCodeValue() == TR::instanceof &&
firstChild->getRegister() == NULL &&
node->getReferenceCount() <=1 &&
(value == 0 || value == 1))
Expand Down
3 changes: 1 addition & 2 deletions compiler/codegen/OMRTreeEvaluator.cpp
Expand Up @@ -386,8 +386,7 @@ bool OMR::TreeEvaluator::instanceOfOrCheckCastNeedSuperTest(TR::Node * node, TR:
!TR::Compiler->cls.isClassArray(cg->comp(), clazz) &&
!TR::Compiler->cls.isInterfaceClass(cg->comp(), clazz) &&
!TR::Compiler->cls.isClassFinal(cg->comp(), clazz) &&
helperSym->preservesAllRegisters() &&
!cg->comp()->getOption(TR_OptimizeForSpace))
helperSym->preservesAllRegisters())
return true;
}
return false;
Expand Down
2 changes: 1 addition & 1 deletion compiler/compile/OMRCompilation.hpp
Expand Up @@ -431,7 +431,7 @@ class OMR_EXTENSIBLE Compilation

bool useRegisterMaps();

bool suppressAllocationInlining() {return _options->getOption(TR_DisableAllocationInlining) || _options->getOption(TR_OptimizeForSpace);}
bool suppressAllocationInlining() {return _options->getOption(TR_DisableAllocationInlining);}

// ==========================================================================
// OMR utility
Expand Down
2 changes: 1 addition & 1 deletion compiler/control/OMROptions.hpp
Expand Up @@ -97,7 +97,7 @@ enum TR_CompilationOptions
TR_StrictFPCompares = 0x00000800,
TR_RegisterMaps = 0x00001000,
TR_CreatePCMaps = 0x00002000,
TR_OptimizeForSpace = 0x00004000,
// Available = 0x00004000,
TR_MimicInterpreterFrameShape = 0x00008000,

TR_TraceBC = 0x00010000,
Expand Down
3 changes: 1 addition & 2 deletions compiler/p/codegen/ControlFlowEvaluator.cpp
Expand Up @@ -1932,8 +1932,7 @@ if (cg->profiledPointersRequireRelocation() && secondChild->getOpCodeValue() ==
int64_t value = secondChild->getOpCode().isLoadConst() ? secondChild->get64bitIntegralValue() : 0;
bool cannotInline = false;
if ((firstChild->getOpCodeValue() == TR::instanceof) &&
!(comp->getOption(TR_OptimizeForSpace) ||
comp->getOption(TR_DisableInlineIfInstanceOf)) &&
!comp->getOption(TR_DisableInlineIfInstanceOf) &&
(firstChild->getRegister() == NULL) &&
(node->getReferenceCount() <=1) &&
secondChild->getOpCode().isLoadConst() &&
Expand Down
6 changes: 2 additions & 4 deletions compiler/p/codegen/PPCSystemLinkage.cpp
Expand Up @@ -681,8 +681,7 @@ TR::PPCSystemLinkage::createPrologue(
if (savedFirst <= TR::RealRegister::LastGPR)
{
if (cg()->comp()->target().cpu.is(OMR_PROCESSOR_PPC_GP) || cg()->comp()->target().is64Bit() ||
(!comp()->getOption(TR_OptimizeForSpace) &&
TR::RealRegister::LastGPR - savedFirst <= 3))
(TR::RealRegister::LastGPR - savedFirst <= 3))
for (regIndex=TR::RealRegister::LastGPR; regIndex>=savedFirst; regIndex=(TR::RealRegister::RegNum)((uint32_t)regIndex-1))
{
argSize = argSize - TR::Compiler->om.sizeofReferenceAddress();
Expand Down Expand Up @@ -783,8 +782,7 @@ TR::PPCSystemLinkage::createEpilogue(TR::Instruction *cursor)
if (savedFirst <= TR::RealRegister::LastGPR)
{
if (cg()->comp()->target().cpu.is(OMR_PROCESSOR_PPC_GP) || cg()->comp()->target().is64Bit() ||
(!comp()->getOption(TR_OptimizeForSpace) &&
TR::RealRegister::LastGPR - savedFirst <= 3))
(TR::RealRegister::LastGPR - savedFirst <= 3))
for (regIndex=TR::RealRegister::LastGPR; regIndex>=savedFirst; regIndex=(TR::RealRegister::RegNum)((uint32_t)regIndex-1))
{
saveSize = saveSize - TR::Compiler->om.sizeofReferenceAddress();
Expand Down
12 changes: 2 additions & 10 deletions compiler/x/codegen/OMRTreeEvaluator.cpp
Expand Up @@ -902,17 +902,9 @@ TR::Register *OMR::X86::TreeEvaluator::integerStoreEvaluator(TR::Node *node, TR:
}
else
{
// Memory update is a win if there is register pressure or if we are
// optimizing for space
//
if (comp->getOption(TR_OptimizeForSpace))
int32_t numRegs = cg->getLiveRegisters(TR_GPR)->getNumberOfLiveRegisters();
if (numRegs >= TR::RealRegister::LastAssignableGPR - 2) // -1 for VM thread reg, -1 fudge
valueChild->setDirectMemoryUpdate(true);
else
{
int32_t numRegs = cg->getLiveRegisters(TR_GPR)->getNumberOfLiveRegisters();
if (numRegs >= TR::RealRegister::LastAssignableGPR - 2) // -1 for VM thread reg, -1 fudge
valueChild->setDirectMemoryUpdate(true);
}
}
}

Expand Down
2 changes: 1 addition & 1 deletion compiler/z/codegen/ControlFlowEvaluator.cpp
Expand Up @@ -878,7 +878,7 @@ OMR::Z::TreeEvaluator::ificmpeqEvaluator(TR::Node * node, TR::CodeGenerator * cg

#ifdef J9_PROJECT_SPECIFIC
if ((firstChild->getOpCodeValue() == TR::instanceof) &&
!(comp->getOption(TR_OptimizeForSpace) || debug("noInlineIfInstanceOf")) &&
!(debug("noInlineIfInstanceOf")) &&
(firstChild->getRegister() == NULL) &&
(node->getReferenceCount() <= 1) &&
secondChild->getOpCode().isLoadConst() &&
Expand Down

0 comments on commit 20d6734

Please sign in to comment.