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

Rename disableTOCForConsts option and disable TOC when the opti… #4443

Merged
merged 2 commits into from
Dec 4, 2019
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
4 changes: 2 additions & 2 deletions compiler/arm/codegen/ConstantDataSnippet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ int32_t TR::ARMConstantDataSnippet::addConstantRequest(void *v,
{
fcursor = new (_cg->trHeapMemory()) TR::ARMConstant<float>(_cg, fin.fvalue);
_floatConstants.add(fcursor);
if (TR::Compiler->target.is64Bit() && !comp->getOption(TR_DisableTOCForConsts))
if (TR::Compiler->target.is64Bit() && !comp->getOption(TR_DisableTOC))
{
ret = TR_ARMTableOfConstants::lookUp(fin.fvalue, _cg);
fcursor->setTOCOffset(ret);
Expand Down Expand Up @@ -102,7 +102,7 @@ int32_t TR::ARMConstantDataSnippet::addConstantRequest(void *v,
{
dcursor = new (_cg->trHeapMemory()) TR::ARMConstant<double>(_cg, din.dvalue);
_doubleConstants.add(dcursor);
if (TR::Compiler->target.is64Bit() && !comp->getOption(TR_DisableTOCForConsts))
if (TR::Compiler->target.is64Bit() && !comp->getOption(TR_DisableTOC))
{
ret = TR_ARMTableOfConstants::lookUp(din.dvalue, _cg);
dcursor->setTOCOffset(ret);
Expand Down
2 changes: 1 addition & 1 deletion compiler/control/OMROptions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -539,7 +539,7 @@ TR::OptionTable OMR::Options::_jitOptions[] = {
{"disableTLE", "O\tdisable transactional lock elision", SET_OPTION_BIT(TR_DisableTLE), "F"},
{"disableTlhPrefetch", "O\tdisable software prefetch on allocation", SET_OPTION_BIT(TR_DisableTLHPrefetch), "F"},
{"disableTM", "O\tdisable transactional memory support", SET_OPTION_BIT(TR_DisableTM), "F"},
{"disableTOCForConsts", "O\tdisable use of the TOC for constants and floats materialization", SET_OPTION_BIT(TR_DisableTOCForConsts), "F"},
{"disableTOC", "O\tdisable use of the Table of Constants (TOC) on relevant architectures", SET_OPTION_BIT(TR_DisableTOC), "F"},
{"disableTraceRegDeps", "O\tdisable printing of register dependancies for each instruction in trace file", SET_OPTION_BIT(TR_DisableTraceRegDeps), "F"},
{"disableTraps", "C\tdisable trap instructions", SET_OPTION_BIT(TR_DisableTraps), "F"},
{"disableTreeCleansing", "O\tdisable tree cleansing", TR::Options::disableOptimization, treesCleansing, 0, "P"},
Expand Down
2 changes: 1 addition & 1 deletion compiler/control/OMROptions.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ enum TR_CompilationOptions
TR_TurnOffSelectiveNoOptServerIfNoStartupHint = 0x01000000 + 7,
TR_TraceDominators = 0x02000000 + 7,
TR_EnableHCR = 0x04000000 + 7, // enable hot code replacement
TR_DisableTOCForConsts = 0x08000000 + 7,
TR_DisableTOC = 0x08000000 + 7,
TR_UseLowPriorityQueueDuringCLP = 0x10000000 + 7,
TR_DisableVectorBCD = 0x20000000 + 7,
// Available = 0x40000000 + 7,
Expand Down
4 changes: 2 additions & 2 deletions compiler/p/codegen/OMRConstantDataSnippet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ int32_t OMR::ConstantDataSnippet::addConstantRequest(void *v,
{
fcursor = new (_cg->trHeapMemory()) PPCConstant<float>(_cg, fin.fvalue);
_floatConstants.add(fcursor);
if (TR::Compiler->target.is64Bit() && !comp->getOption(TR_DisableTOCForConsts))
if (TR::Compiler->target.is64Bit())
{
ret = TR_PPCTableOfConstants::lookUp(fin.fvalue, _cg);
}
Expand Down Expand Up @@ -110,7 +110,7 @@ int32_t OMR::ConstantDataSnippet::addConstantRequest(void *v,
{
dcursor = new (_cg->trHeapMemory()) PPCConstant<double>(_cg, din.dvalue);
_doubleConstants.add(dcursor);
if (TR::Compiler->target.is64Bit() && !comp->getOption(TR_DisableTOCForConsts))
if (TR::Compiler->target.is64Bit())
{
ret = TR_PPCTableOfConstants::lookUp(din.dvalue, _cg);
}
Expand Down
3 changes: 1 addition & 2 deletions compiler/p/codegen/OMRTreeEvaluator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -198,8 +198,7 @@ TR::Instruction *loadConstant(TR::CodeGenerator *cg, TR::Node * node, int64_t va

int32_t offset = PTOC_FULL_INDEX;

bool canUseTOC = (!TR::isJ9() || !isPicSite) &&
!comp->getOption(TR_DisableTOCForConsts);
bool canUseTOC = (!TR::isJ9() || !isPicSite);
if (canUseTOC && useTOC)
offset = TR_PPCTableOfConstants::lookUp((int8_t *)&value, sizeof(int64_t), true, 0, cg);

Expand Down
15 changes: 12 additions & 3 deletions compiler/p/codegen/PPCTableOfConstants.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ TR_PPCTableOfConstants::lookUp(int32_t val, struct TR_tocHashEntry *tmplate, int
{
TR::Compilation *comp = cg->comp();

if (comp->compileRelocatableCode() || (comp->getOption(TR_EnableHCR) && comp->getOption(TR_HCRPatchClassPointers)) || comp->getOption(TR_MimicInterpreterFrameShape))
if (comp->compileRelocatableCode() || comp->getOption(TR_DisableTOC) || (comp->getOption(TR_EnableHCR) && comp->getOption(TR_HCRPatchClassPointers)) || comp->getOption(TR_MimicInterpreterFrameShape))
return PTOC_FULL_INDEX;

if (comp->isOptServer())
Expand Down Expand Up @@ -391,7 +391,7 @@ int32_t TR_PPCTableOfConstants::lookUp(int8_t *name, int32_t len, bool isAddr, i
struct TR_tocHashEntry localEntry;
int32_t val, offsetInSlot;

if (comp->compileRelocatableCode() || (comp->getOption(TR_EnableHCR) && comp->getOption(TR_HCRPatchClassPointers)))
if (comp->compileRelocatableCode() || comp->getOption(TR_DisableTOC) || (comp->getOption(TR_EnableHCR) && comp->getOption(TR_HCRPatchClassPointers)))
return PTOC_FULL_INDEX;

if (comp->isOptServer())
Expand Down Expand Up @@ -424,6 +424,9 @@ int32_t TR_PPCTableOfConstants::lookUp(double dvalue, TR::CodeGenerator *cg)
{
TR::Compilation *comp = cg->comp();

if (comp->getOption(TR_DisableTOC))
return PTOC_FULL_INDEX;

if (comp->isOptServer())
{
if (comp->getMethodHotness() < warm || comp->isDLT() || comp->isProfilingCompilation() || cg->getCurrentBlock()->isCold())
Expand All @@ -450,6 +453,9 @@ int32_t TR_PPCTableOfConstants::lookUp(float fvalue, TR::CodeGenerator *cg)
{
TR::Compilation *comp = cg->comp();

if (comp->getOption(TR_DisableTOC))
return PTOC_FULL_INDEX;

if (comp->isOptServer())
{
if (comp->getMethodHotness() < warm || comp->isDLT() || comp->isProfilingCompilation() || cg->getCurrentBlock()->isCold())
Expand Down Expand Up @@ -478,6 +484,9 @@ int32_t TR_PPCTableOfConstants::lookUp(TR::SymbolReference *symRef, TR::CodeGene
{
TR::Compilation *comp = cg->comp();

if (comp->getOption(TR_DisableTOC))
return PTOC_FULL_INDEX;

if (comp->isOptServer())
{
if (comp->getMethodHotness() < warm || comp->isDLT() || comp->isProfilingCompilation() || cg->getCurrentBlock()->isCold())
Expand Down Expand Up @@ -559,7 +568,7 @@ int32_t TR_PPCTableOfConstants::allocateChunk(uint32_t numEntries, TR::CodeGener
{
TR_PPCTableOfConstants *tocManagement = toPPCTableOfConstants(TR_PersistentMemory::getNonThreadSafePersistentInfo()->getPersistentTOC());

if (tocManagement == NULL || cg->comp()->compileRelocatableCode() || (cg->comp()->getOption(TR_EnableHCR) && cg->comp()->getOption(TR_HCRPatchClassPointers)))
if (tocManagement == NULL || cg->comp()->getOption(TR_DisableTOC) || cg->comp()->compileRelocatableCode() || (cg->comp()->getOption(TR_EnableHCR) && cg->comp()->getOption(TR_HCRPatchClassPointers)))
return PTOC_FULL_INDEX;

if (grabMonitor)
Expand Down