-
Notifications
You must be signed in to change notification settings - Fork 729
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update BCDCHK uncommoning for off-heap #20302
Update BCDCHK uncommoning for off-heap #20302
Conversation
Personal build without off-heap changes to verify that I am not missing any dependencies. Internal issue tracking the failure. Context into the failure:
[1] compare/off-heap...VermaSh:openj9:off-heap_daa_failure?expand=1 "Fix patch" |
8e4f933
to
c934487
Compare
Relaunched personal build without off-heap changes because previous had a lot of infra related failures. |
@@ -62,17 +62,44 @@ UncommonBCDCHKAddressNode::perform() | |||
{ | |||
TR::Node* pdOpNode = node->getFirstChild(); | |||
TR::Node* oldAddressNode = node->getSecondChild(); | |||
TR_ASSERT(pdOpNode && oldAddressNode, "Unexpected null PD opNode or address node under BCDCHK"); | |||
TR_ASSERT(oldAddressNode->getNumChildren() == 2, "Expecting 2 children under address node of BCDCHK."); | |||
TR_ASSERT_FATAL_WITH_NODE(node, pdOpNode && oldAddressNode, "Unexpected null PD opNode or address node under BCDCHK"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I understand that this is the old code, but if the intention of this assert is that both oldAddressNode
and pdOpNode
should be non null, then we should explicitly check that.
|
||
TR::ILOpCodes addressOp = oldAddressNode->getOpCodeValue(); | ||
TR_ASSERT((addressOp == TR::aladd || addressOp == TR::aiadd), "Unexpected addressNode opcode"); | ||
TR_ASSERT_FATAL_WITH_NODE(node, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it make sense to have the expected tree structure comment moved here before the ASSERT to highlight what you are checking here?
TR::Node* newAddressNode = NULL; | ||
if (oldAddressNode->getOpCodeValue() == TR::aloadi) | ||
{ | ||
/* Expected tree structure (probably just loading first array element because offset is 0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you elaborate why probably?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, forgot to take that out. That tree structure is possible only when accessing first array element so "probably" is not needed.
c934487
to
0c75203
Compare
@r30shah I have addressed your suggestions in my latest commit. Launched another off-heap build to confirm everything is still good. |
method == TR::com_ibm_dataaccess_PackedDecimal_remainderPackedDecimal_|| | ||
method == TR::com_ibm_dataaccess_PackedDecimal_shiftLeftPackedDecimal_ || | ||
method == TR::com_ibm_dataaccess_PackedDecimal_shiftRightPackedDecimal_) | ||
TR::Node* oldAddressNode = node->getSecondChild(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TR::BCDCHK has unspecified child properties. Are we guaranteed to have second child?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have updated the if condition to enter only if the node BCDCHK has two children.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was more of a question, but I do not mind the conservative root you took. Do we need to have oldAddressNode
here ? I only see it being used inside the if block.
* array_element_offset | ||
*/ | ||
TR_ASSERT_FATAL_WITH_NODE(node, | ||
oldAddressNode->isDataAddrPointer() && oldAddressNode->getNumChildren() == 1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add brackets here
oldAddressNode->isDataAddrPointer() && oldAddressNode->getNumChildren() == 1 | |
(oldAddressNode->isDataAddrPointer() && oldAddressNode->getNumChildren() == 1) |
oldAddressNode->isDataAddrPointer() && oldAddressNode->getNumChildren() == 1 | ||
|| ((addressOp == TR::aladd || addressOp == TR::aiadd) && oldAddressNode->getNumChildren() == 2), | ||
"Expecting either a dataAddrPointer node with 1 child or a aladd/aiadd with 2 children under address node of BCDCHK." | ||
"But the address (opCode %s) node had %d children and dataAddrPointer flag set to %d\n", oldAddressNode->getOpCode().getName(), oldAddressNode->getNumChildren(), oldAddressNode->isDataAddrPointer()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"But the address (opCode %s) node had %d children and dataAddrPointer flag set to %d\n", oldAddressNode->getOpCode().getName(), oldAddressNode->getNumChildren(), oldAddressNode->isDataAddrPointer()); | |
"But the address node %s had %d children and dataAddrPointer flag set to %s\n", oldAddressNode->getOpCode().getName(), oldAddressNode->getNumChildren(), oldAddressNode->isDataAddrPointer() ? "true" : "false"); |
"But the address (opCode %s) node had %d children and dataAddrPointer flag set to %d\n", oldAddressNode->getOpCode().getName(), oldAddressNode->getNumChildren(), oldAddressNode->isDataAddrPointer()); | ||
TR::Node* newAddressNode = NULL; | ||
if (oldAddressNode->getOpCodeValue() == TR::aloadi) | ||
{ // handles expected tree structure 2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will leave it up to your preference, but I would put the comment in next line.
} | ||
else | ||
{ // handles expected tree structure 1 and 3 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similar comment as for line 91
0c75203
to
86f3da4
Compare
Launched another off-heap personal build for verification. |
@r30shah This is ready for another review. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, giving soft approval, will wait for you to push change that moved getting oldAddressNode in the if block and then launch the sanity tests. I am satisfied with the internal testing you have done.
method == TR::com_ibm_dataaccess_PackedDecimal_remainderPackedDecimal_|| | ||
method == TR::com_ibm_dataaccess_PackedDecimal_shiftLeftPackedDecimal_ || | ||
method == TR::com_ibm_dataaccess_PackedDecimal_shiftRightPackedDecimal_) | ||
TR::Node* oldAddressNode = node->getSecondChild(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was more of a question, but I do not mind the conservative root you took. Do we need to have oldAddressNode
here ? I only see it being used inside the if block.
{ | ||
TR::RecognizedMethod method = node->getSymbol()->getResolvedMethodSymbol()->getRecognizedMethod(); | ||
TR::Node* oldAddressNode = node->getSecondChild(); | ||
if(method == TR::com_ibm_dataaccess_DecimalData_convertIntegerToPackedDecimal_ || |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do not want to stretch this PR too much as it is fixing the functional issue, and following question is related to code that already exists so we can probably in future change this.
Instead of having a large if condition check, we should take out the check for recog. DAA method to a separate function and have a switch case in that function, that will make this code more readable.
Again, suggestion as it is something I observed in the PR.
Update BCDCHK uncommoning for off-heap because address node of BCDCHK can be aloadi with single child if off-heap is enabled. Signed-off-by: Shubham Verma <[email protected]>
86f3da4
to
aa6d3d9
Compare
We don't need |
Jenkins test sanity zlinux jdk21,jdk11 |
Update BCDCHK uncommoning for off-heap because address node of BCDCHK can be aloadi with single child if off-heap is enabled.