Skip to content

Commit

Permalink
Reset _defMergedNodes in global VP on every basic block
Browse files Browse the repository at this point in the history
_defMergedNodes is supposed to keep track of commonned nodes.
So it's safe to reset it on every basic block. Also add an assert
that there are no extended blocks during global VP.
  • Loading branch information
gita-omr committed Aug 10, 2021
1 parent 9ebd8f0 commit f79041a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion compiler/optimizer/OMRValuePropagation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4081,7 +4081,6 @@ void TR::GlobalValuePropagation::processStructure(TR_StructureSubGraphNode *node
TR_RegionStructure *region = node->getStructure()->asRegion();
if (region)
{
_defMergedNodes->empty();
if (region->isAcyclic())
{
processAcyclicRegion(node, lastTimeThrough, insideLoop);
Expand All @@ -4097,6 +4096,10 @@ void TR::GlobalValuePropagation::processStructure(TR_StructureSubGraphNode *node
}
else
{
// Only commoned nodes within a block need to be set in _defMergedNodes.
// So it should be reset here
TR_ASSERT_FATAL(!node->getStructure()->asBlock()->getBlock()->isExtensionOfPreviousBlock(), "This optimization does not run on extended blocks");
_defMergedNodes->empty();
processBlock(node, lastTimeThrough, insideLoop);
}
}
Expand Down

0 comments on commit f79041a

Please sign in to comment.