Skip to content

Commit

Permalink
Remove get and setAccessStaticsIndirectly from Z
Browse files Browse the repository at this point in the history
This query is no longer needed and so it is removed
by this commit. Also delete an unused routine while
in the area.

Signed-off-by: Dhruv Chopra <Dhruv.C.Chopra@ibm.com>
  • Loading branch information
dchopra001 committed Jan 4, 2021
1 parent 1a7415d commit 894baef
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 102 deletions.
5 changes: 1 addition & 4 deletions compiler/codegen/OMRCodeGenerator.hpp
Expand Up @@ -1577,9 +1577,6 @@ class OMR_EXTENSIBLE CodeGenerator
bool getMethodContainsBinaryCodedDecimal() { return _flags3.testAny(MethodContainsBinaryCodedDecimal);}
void setMethodContainsBinaryCodedDecimal() { _flags3.set(MethodContainsBinaryCodedDecimal);}

bool getAccessStaticsIndirectly() {return _flags1.testAny(AccessStaticsIndirectly);}
void setAccessStaticsIndirectly(bool b) {_flags1.set(AccessStaticsIndirectly, b);}

bool getSupportsBDLLHardwareOverflowCheck() { return _flags3.testAny(SupportsBDLLHardwareOverflowCheck);}
void setSupportsBDLLHardwareOverflowCheck() { _flags3.set(SupportsBDLLHardwareOverflowCheck);}

Expand Down Expand Up @@ -1762,7 +1759,7 @@ class OMR_EXTENSIBLE CodeGenerator
// AVAILABLE = 0x02000000,
UsesRegisterPairsForLongs = 0x04000000,
SupportsArraySet = 0x08000000,
AccessStaticsIndirectly = 0x10000000,
// AVAILABLE = 0x10000000,
SupportsArrayCmp = 0x20000000,
DisableLongGRA = 0x40000000,
DummyLastEnum1
Expand Down
38 changes: 4 additions & 34 deletions compiler/il/OMRTreeTop.cpp
Expand Up @@ -74,26 +74,10 @@ OMR::TreeTop::createIncTree(TR::Compilation * comp, TR::Node *node, TR::SymbolRe
TR::StaticSymbol * symbol = symRef->getSymbol()->castToStaticSymbol();
TR::DataType type = symbol->getDataType();
TR::Node * storeNode;
if (comp->cg()->getAccessStaticsIndirectly() && !symRef->isUnresolved() && type != TR::Address)
{
TR::SymbolReference * symRefShadow;
if (isRecompCounter)
symRefShadow = comp->getSymRefTab()->findOrCreateCounterAddressSymbolRef();
else
symRefShadow = comp->getSymRefTab()->createKnownStaticDataSymbolRef(symbol->getStaticAddress(), TR::Address);
TR::Node * loadaddrNode = TR::Node::createWithSymRef(node, TR::loadaddr, 0, symRefShadow);
storeNode = TR::Node::createWithSymRef(TR::istorei, 2, 2, loadaddrNode,
TR::Node::create(TR::iadd, 2,
TR::Node::createWithSymRef(TR::iloadi, 1, 1, loadaddrNode, symRef),
TR::Node::create(node, TR::iconst, 0, incAmount)), symRef);
}
else
{
storeNode = TR::Node::createWithSymRef(TR::istore, 1, 1,
storeNode = TR::Node::createWithSymRef(TR::istore, 1, 1,
TR::Node::create(TR::iadd, 2,
TR::Node::createWithSymRef(node, TR::iload, 0, symRef),
TR::Node::create(node, TR::iconst, 0, incAmount)), symRef);
}
TR::Node::createWithSymRef(node, TR::iload, 0, symRef),
TR::Node::create(node, TR::iconst, 0, incAmount)), symRef);
return precedingTreeTop == NULL ? TR::TreeTop::create(comp, storeNode) : TR::TreeTop::create(comp, precedingTreeTop, storeNode);
}

Expand All @@ -103,22 +87,8 @@ OMR::TreeTop::createResetTree(TR::Compilation * comp, TR::Node *node, TR::Symbol
TR::StaticSymbol * symbol = symRef->getSymbol()->castToStaticSymbol();
TR::DataType type = symbol->getDataType();
TR::Node * storeNode;
if (comp->cg()->getAccessStaticsIndirectly() && !symRef->isUnresolved() && type != TR::Address)
{
TR::SymbolReference * symRefShadow;
if (isRecompCounter)
symRefShadow = comp->getSymRefTab()->findOrCreateCounterAddressSymbolRef();
else
symRefShadow = comp->getSymRefTab()->createKnownStaticDataSymbolRef(symbol->getStaticAddress(), TR::Address);
TR::Node * loadaddrNode = TR::Node::createWithSymRef(node, TR::loadaddr, 0, symRefShadow);
storeNode = TR::Node::createWithSymRef(TR::istorei, 2, 2, loadaddrNode,
TR::Node::create(node, TR::iconst, 0, resetAmount), symRef);
}
else
{
storeNode = TR::Node::createWithSymRef(TR::istore, 1, 1,
storeNode = TR::Node::createWithSymRef(TR::istore, 1, 1,
TR::Node::create(node, TR::iconst, 0, resetAmount), symRef);
}
return precedingTreeTop == NULL ? TR::TreeTop::create(comp, storeNode) : TR::TreeTop::create(comp, precedingTreeTop, storeNode);
}

Expand Down
3 changes: 1 addition & 2 deletions compiler/optimizer/LoadExtensions.cpp
Expand Up @@ -192,8 +192,7 @@ const bool TR_LoadExtensions::isSupportedType(TR::Node* node) const
bool result = node->getType().isIntegral() || node->getType().isAddress();

// Disallow static integral loads of size smaller than an int
if (!TR::comp()->cg()->getAccessStaticsIndirectly() &&
node->getOpCode().isLoadDirect() &&
if (node->getOpCode().isLoadDirect() &&
node->getOpCode().hasSymbolReference() && node->getSymbol()->isStatic() &&
!node->getOpCode().isInt() && !node->getOpCode().isLong())
{
Expand Down
61 changes: 0 additions & 61 deletions compiler/z/codegen/OMRCodeGenerator.cpp
Expand Up @@ -613,7 +613,6 @@ OMR::Z::CodeGenerator::initialize()
cg->getS390Linkage()->setParameterLinkageRegisterIndex(comp->getJittedMethodSymbol());

cg->getS390Linkage()->initS390RealRegisterLinkage();
cg->setAccessStaticsIndirectly(true);
}


Expand Down Expand Up @@ -5599,66 +5598,6 @@ OMR::Z::CodeGenerator::checkIfcmpxx(TR::Node *node)
}
}

// Z
bool
OMR::Z::CodeGenerator::checkSimpleLoadStore(TR::Node *loadNode, TR::Node *storeNode, TR::Block *block)
{
//The pattern below leads to use index reg in addressing, LAY for example, that costs extra for instructions like MVC.
// aiadd
// load-addr
// laod-non-const

//traceMsg(comp(), "Considering storeNode %p and loadNode %p\n",storeNode,loadNode);

if (loadNode->getOpCode().isIndirect() &&
loadNode->getFirstChild()->getNumChildren() > 1 &&
loadNode->getFirstChild()->getOpCode().isAdd() &&
!loadNode->getFirstChild()->getSecondChild()->getOpCode().isLoadConst())
{
return false;
}
else if (storeNode->getOpCode().isIndirect() &&
storeNode->getFirstChild()->getNumChildren() > 1 &&
storeNode->getFirstChild()->getOpCode().isAdd() &&
!storeNode->getFirstChild()->getSecondChild()->getOpCode().isLoadConst())
{
return false;
}
else if (loadNode->getSize() != storeNode->getSize())
{
return false;
}
else if ( !self()->getAccessStaticsIndirectly() && (
(storeNode->getOpCode().hasSymbolReference() && storeNode->getSymbol()->isStatic() && !storeNode->getOpCode().isIndirect()) ||
(loadNode->getOpCode().hasSymbolReference() && loadNode->getSymbol()->isStatic() && !loadNode->getOpCode().isIndirect())
)
)
{

return false;
}
else if (loadNode->getOpCode().isLoadConst()&&
loadNode->getReferenceCount() == 1 )
{//The const may be loaded into reg and shared. So dont do it.
return true;
}
else if (loadNode->getOpCode().isLoadVar() &&
loadNode->getReferenceCount() == 1 &&
loadNode->getSymbolReference())
{
if (storeNode->getSize() == 1 && loadNode->getSize() == 1)
return true;
else if (self()->loadAndStoreMayOverlap(storeNode, storeNode->getSize(), loadNode, loadNode->getSize()))
return false;
else
return true;
}
else
{
return false;
}
}

bool
OMR::Z::CodeGenerator::checkBitWiseChild(TR::Node *node)
{
Expand Down
1 change: 0 additions & 1 deletion compiler/z/codegen/OMRCodeGenerator.hpp
Expand Up @@ -438,7 +438,6 @@ class OMR_EXTENSIBLE CodeGenerator : public OMR::CodeGenerator
bool loadAndStoreMayOverlap(TR::Node *store, size_t storeSize, TR::Node *load, size_t loadSize);

bool checkIfcmpxx(TR::Node *node);
bool checkSimpleLoadStore(TR::Node *loadNode, TR::Node *storeNode, TR::Block *block);
bool checkBitWiseChild(TR::Node *node);

TR_StorageDestructiveOverlapInfo getStorageDestructiveOverlapInfo(TR::Node *src, size_t srcLength, TR::Node *dst, size_t dstLength);
Expand Down

0 comments on commit 894baef

Please sign in to comment.