From 2b85c077a19e0716e17af82634e1bda2ba198198 Mon Sep 17 00:00:00 2001 From: Abdulrahman Alattas Date: Mon, 16 Dec 2024 10:52:37 -0500 Subject: [PATCH] Compare nodes instead of symRef in SequentialStoreSimplification SequentialStoreSimplification compares baseVar symRef to confirm stores being to the same array for simplification. For object fields the symRef matches even if arrays are different. To fix the issue a node check is used instead to make sure that its storing to the same array even if symRefs match. --- runtime/compiler/optimizer/SequentialStoreSimplifier.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/runtime/compiler/optimizer/SequentialStoreSimplifier.cpp b/runtime/compiler/optimizer/SequentialStoreSimplifier.cpp index 366eec56d65..147833540b2 100644 --- a/runtime/compiler/optimizer/SequentialStoreSimplifier.cpp +++ b/runtime/compiler/optimizer/SequentialStoreSimplifier.cpp @@ -1655,8 +1655,9 @@ bool TR_arraycopySequentialStores::insertConsistentTree() dumpOptDetails(comp(), " insertTree: multiplier must be 1 in aiadd tree\n"); return false; } - TR::SymbolReference* activeBaseRef = _activeAddrTree->getBaseVarNode()->isNull() ? NULL : _activeAddrTree->getBaseVarNode()->getChild()->skipConversions()->getSymbolReference(); - if (activeBaseRef == NULL) + + TR::Node* activeBaseNode = _activeAddrTree->getBaseVarNode()->isNull() ? NULL : _activeAddrTree->getBaseVarNode()->getChild()->skipConversions(); + if (activeBaseNode == NULL) { dumpOptDetails(comp(), " insertTree: no base variable in aiadd tree\n"); return false; @@ -1670,8 +1671,9 @@ bool TR_arraycopySequentialStores::insertConsistentTree() } // make sure the index variable and base variable is consistent with the first tree + TR::Node* baseNode = _addrTree[0]->getBaseVarNode()->isNull() ? NULL : _addrTree[0]->getBaseVarNode()->getChild()->skipConversions(); TR::SymbolReference* baseRef = _addrTree[0]->getBaseVarNode()->isNull() ? NULL : _addrTree[0]->getBaseVarNode()->getChild()->skipConversions()->getSymbolReference(); - if (baseRef != activeBaseRef) + if (baseNode != activeBaseNode) { dumpOptDetails(comp(), " insertTree: base variable is different than previous tree\n"); return false;