Skip to content

Commit

Permalink
Merge pull request #7014 from a7ehuo/fix-missing-l2a-evaluation-3
Browse files Browse the repository at this point in the history
Do not skip l2a if the memory reference has unresolved snippet
  • Loading branch information
0xdaryl authored Jun 1, 2023
2 parents 7bb2131 + 11ca01b commit 0e57234
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 deletions.
5 changes: 4 additions & 1 deletion compiler/p/codegen/OMRMemoryReference.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -586,7 +586,10 @@ void OMR::Power::MemoryReference::populateMemoryReference(TR::Node *subTree, TR:
{
if (cg->comp()->useCompressedPointers())
{
if (subTree->getOpCodeValue() == TR::l2a && subTree->getReferenceCount() == 1 && subTree->getRegister() == NULL)
if ((subTree->getOpCodeValue() == TR::l2a) &&
(subTree->getReferenceCount() == 1) &&
(subTree->getRegister() == NULL) &&
!self()->getUnresolvedSnippet()) // If there is unresolved data snippet, l2a cannot be skipped
{
cg->decReferenceCount(subTree);
subTree = subTree->getFirstChild();
Expand Down
6 changes: 4 additions & 2 deletions compiler/x/codegen/OMRMemoryReference.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -520,8 +520,10 @@ OMR::X86::MemoryReference::populateMemoryReference(

if (comp->useCompressedPointers())
{
if ((subTree->getOpCodeValue() == TR::l2a) && (subTree->getReferenceCount() == 1) &&
(subTree->getRegister() == NULL))
if ((subTree->getOpCodeValue() == TR::l2a) &&
(subTree->getReferenceCount() == 1) &&
(subTree->getRegister() == NULL) &&
!self()->hasUnresolvedDataSnippet()) // If there is unresolved data snippet, l2a cannot be skipped
{
cg->decReferenceCount(subTree);
subTree = subTree->getFirstChild();
Expand Down
7 changes: 5 additions & 2 deletions compiler/z/codegen/OMRMemoryReference.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1798,8 +1798,11 @@ OMR::Z::MemoryReference::populateMemoryReference(TR::Node * subTree, TR::CodeGen

noteAllNodesWithRefCountNotOne(nodesBefore, subTree, comp);

if (((comp->useCompressedPointers() && subTree->getOpCodeValue() == TR::l2a))
&& (subTree->getReferenceCount() == 1) && (subTree->getRegister() == NULL))
if (comp->useCompressedPointers() &&
(subTree->getOpCodeValue() == TR::l2a) &&
(subTree->getReferenceCount() == 1) &&
(subTree->getRegister() == NULL) &&
!self()->getUnresolvedSnippet()) // If there is unresolved data snippet, l2a cannot be skipped
{
noopNode = subTree;
subTree = subTree->getFirstChild();
Expand Down

0 comments on commit 0e57234

Please sign in to comment.