Skip to content

Commit

Permalink
Merge pull request #16455 from hzongaro/flush-elimination-compile-tim…
Browse files Browse the repository at this point in the history
…e-perf

Avoid calling getEnclosingBlock
  • Loading branch information
vijaysun-omr authored Dec 12, 2022
2 parents 60a4172 + 42b0411 commit 108f918
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions runtime/compiler/optimizer/EscapeAnalysis.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9153,7 +9153,7 @@ int32_t TR_LocalFlushElimination::perform()
_allocationInfo->empty();
}

examineNode(node, treeTop, visited);
examineNode(node, treeTop, block, visited);
}

FlushCandidate *flushCandidate;
Expand All @@ -9174,7 +9174,7 @@ int32_t TR_LocalFlushElimination::perform()
}


bool TR_LocalFlushElimination::examineNode(TR::Node *node, TR::TreeTop *tt, TR::NodeChecklist& visited)
bool TR_LocalFlushElimination::examineNode(TR::Node *node, TR::TreeTop *tt, TR::Block *currBlock, TR::NodeChecklist& visited)
{
if (visited.contains(node))
return true;
Expand Down Expand Up @@ -9356,7 +9356,7 @@ bool TR_LocalFlushElimination::examineNode(TR::Node *node, TR::TreeTop *tt, TR::
{
if (reachingFlushCandidate->isOptimallyPlaced() ||
reachingFlushCandidate->getFlush()->getNode()->getAllocation() == NULL ||
reachingFlushCandidate->getBlockNum() != tt->getEnclosingBlock()->getNumber())
reachingFlushCandidate->getBlockNum() != currBlock->getNumber())
continue;
reachingCandidate = getCandidate(_candidates, reachingFlushCandidate);
if (!reachingCandidate)
Expand Down Expand Up @@ -9531,7 +9531,7 @@ bool TR_LocalFlushElimination::examineNode(TR::Node *node, TR::TreeTop *tt, TR::
{
TR::Node *child = node->getChild(i);

if (!examineNode(child, tt, visited))
if (!examineNode(child, tt, currBlock, visited))
return false;
}

Expand Down
2 changes: 1 addition & 1 deletion runtime/compiler/optimizer/EscapeAnalysis.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -803,7 +803,7 @@ class TR_LocalFlushElimination
TR_LocalFlushElimination(TR_EscapeAnalysis *, int32_t numAllocations);

virtual int32_t perform();
bool examineNode(TR::Node *, TR::TreeTop *, TR::NodeChecklist& visited);
bool examineNode(TR::Node *, TR::TreeTop *, TR::Block *, TR::NodeChecklist& visited);

TR::Optimizer * optimizer() { return _escapeAnalysis->optimizer(); }
TR::Compilation * comp() { return _escapeAnalysis->comp(); }
Expand Down

0 comments on commit 108f918

Please sign in to comment.