Skip to content

Commit

Permalink
Fix trees around split point in PostGRA block splitter
Browse files Browse the repository at this point in the history
Before uncommoning the nodes between split points, make sure the
uncommoning won't won't orphan any commoned out compressedrefs anchor
node.

Signed-off-by: Rahil Shah <rahil@ca.ibm.com>
  • Loading branch information
r30shah committed Dec 11, 2020
1 parent 4c466e6 commit 456aa09
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions compiler/il/OMRBlock.cpp
Expand Up @@ -1423,6 +1423,27 @@ OMR::Block::splitPostGRA(TR::TreeTop * startOfNewBlock, TR::CFG *cfg, bool copyE
}
}
}
else if(node->getOpCodeValue() == TR::compressedRefs)
{
TR::Node *anchoredNode = node->getFirstChild();
auto nodeInfoEntry = nodeInfo->find(anchoredNode);

if (nodeInfoEntry != nodeInfo->end())
{
// Moving the compressedref anchor node before the split point
iter->unlink(false);
self()->getExit()->insertBefore(iter);
// Now Update the Node Info if the anchored node is the only reference after splitpoint
if (nodeInfoEntry->second.first == 1)
{
nodeInfo->erase(nodeInfoEntry);
auto storeNodeEntry = storeNodeInfo->find(anchoredNode);
if (storeNodeEntry != storeNodeInfo->end())
storeNodeInfo->erase(storeNodeEntry);
}
}
}

if (nextTreeTop == nextExtendedBlockEntry) // TreeTop Node is BBExit and next tree top is nextExtendedBlockEntry
{
TR::Node *regDeps = iter->getNode()->getNumChildren() > 0 ? iter->getNode()->getChild(0) : NULL;
Expand Down

0 comments on commit 456aa09

Please sign in to comment.