diff --git a/compiler/optimizer/OMRValuePropagation.cpp b/compiler/optimizer/OMRValuePropagation.cpp index c8bf0c21f38..ebe39bbcd9e 100644 --- a/compiler/optimizer/OMRValuePropagation.cpp +++ b/compiler/optimizer/OMRValuePropagation.cpp @@ -4091,14 +4091,15 @@ void TR::GlobalValuePropagation::processStructure(TR_StructureSubGraphNode *node } else { - // Only commoned nodes within an extended block need to be set - // in _defMergedNodes. So it's safe to reset it here - _defMergedNodes->empty(); processImproperLoop(node, lastTimeThrough, insideLoop); } } 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); } } @@ -4469,10 +4470,6 @@ void TR::GlobalValuePropagation::processRegionSubgraph(TR_StructureSubGraphNode // Current constraints have already been set up to be the input constraints. // - // Only commoned nodes within an extended block need to be set - // in _defMergedNodes. So it's safe to reset it here - _defMergedNodes->empty(); - TR_RegionStructure *region = node->getStructure()->asRegion(); TR_StructureSubGraphNode *entry = region->getEntry();