Skip to content
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

Add missing checks to convert store to load #19810

Merged
merged 1 commit into from
Jul 17, 2024

Conversation

VermaSh
Copy link
Contributor

@VermaSh VermaSh commented Jul 4, 2024

These checks were accidentally removed in
Update IdiomRecognitionUtils.cpp to use new TransformUtil APIs commit.

Fixes: #19666

@VermaSh
Copy link
Contributor Author

VermaSh commented Jul 4, 2024

cc: @r30shah @zl-wang
Need to do one last round of testing before I remove the WIP tag.

@VermaSh
Copy link
Contributor Author

VermaSh commented Jul 4, 2024

For reference, we were failing because we were missing call to convertStoreToLoadWithI2LIfNecessary for the index node [1]. Other changes in this PR are to improve readability and to stay consistent with other call sites in the code.

[1]

top = convertStoreToLoadWithI2LIfNecessary(comp, is64bit, indexNode);

Copy link
Contributor

@r30shah r30shah left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a comment, not suggesting change rn. Will wait for WIP to get removed.

createIndexOffsetTree(TR::Compilation *comp, bool is64bit, TR::Node *indexNode, int multiply)
{
TR::Node *c1 = createBytesFromElement(comp, is64bit, indexNode, multiply);
return TR::TransformUtil::generateConvertArrayElementIndexToOffsetTrees(comp, c1, NULL, multiply);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking at the method generateConvertArrayElementIndexToOffsetTrees it takes int32_t not int. Should we fix this ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While comparing this change to pre off-heap code I realized that we don't need to call generateConvertArrayElementIndexToOffsetTrees so that should take care of the type miss match.

@VermaSh
Copy link
Contributor Author

VermaSh commented Jul 5, 2024

Local testing passed without any failure. Comparing the failing and passing logs to get the trees responsible for the failure.

These checks were accidentally removed in
`Update IdiomRecognitionUtils.cpp to use new TransformUtil APIs` commit.

Signed-off-by: Shubham Verma <shubhamv.sv@gmail.com>
@VermaSh
Copy link
Contributor Author

VermaSh commented Jul 10, 2024

This doesn't fix #19666 but still needed because it fixes index node reference count bug. The index node ends up with reference count higher than actual number of references resulting in a register being kept alive longer than it should. The original code duplicated the index node before using it in new array address trees, the duplication was accidentally removed during the code refactoring for off-heap changes.

While going through the off-heap change I noticed that the original code was subtracting - array header size whereas we are adding array header size. I am in the process of updating the TR::TransformUtil:: APIs to support this, should have a WIP PR soon. I'll leave the WIP tag for now because this code will need to be updated again after the transform util changes have been merged.

@VermaSh
Copy link
Contributor Author

VermaSh commented Jul 10, 2024

WIP PR for OMR dependency eclipse-omr/omr#7405

@zl-wang
Copy link
Contributor

zl-wang commented Jul 10, 2024

be careful with that though: @rmnattas once pointed it out to me that the subtraction is needed because caller added it already. in off-heap case, you access elements with dataAddr pointer such that you need to effectively make arrayBaseOffset as zero (so that subtraction is needed).

@VermaSh
Copy link
Contributor Author

VermaSh commented Jul 11, 2024

@zl-wang I am not removing the subtraction. It wasn't really a subtraction actually, we were adding header size to the offset by subtracting negative header size from it. The subtraction got replaced by addition so this change just reverts it back to subtraction. This change applies only to non off-heap path.

@VermaSh
Copy link
Contributor Author

VermaSh commented Jul 12, 2024

Removing my second commit to remove OMR dependency so that this can be merged sooner as my OMR change is causing failures. This change on it's own fixes #19666, I'll launch a personal build to verify this.

@VermaSh
Copy link
Contributor Author

VermaSh commented Jul 12, 2024

Copy link
Contributor

@r30shah r30shah left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Checking out this change alone (I do think what Julian mentioned could be a issue needs to be checked at for the OMR PR), Comparing changes in this PR with the Utils without changes added for supporting off-heap, it looks good to me.

@zl-wang Appreciate if you can also review the changes.

@r30shah
Copy link
Contributor

r30shah commented Jul 15, 2024

jenkins test sanity.functional all jdk11,jdk21

@VermaSh
Copy link
Contributor Author

VermaSh commented Jul 15, 2024

My personal build passed without failures so removing WIP tag.

@VermaSh VermaSh changed the title WIP: Add missing checks to convert store to load Add missing checks to convert store to load Jul 15, 2024
@r30shah
Copy link
Contributor

r30shah commented Jul 16, 2024

@VermaSh Can you verify if failures on windows are related or not ?

@VermaSh
Copy link
Contributor Author

VermaSh commented Jul 16, 2024

@r30shah x builds were aborted because all nodes were offline

@r30shah
Copy link
Contributor

r30shah commented Jul 16, 2024

jenkins test sanity.functional win jdk11,jdk21

@r30shah
Copy link
Contributor

r30shah commented Jul 16, 2024

Based on the testing done by Shubham and finished tests on other platform, I do not think this will cause any issue on windows, and we can merge this safely.

@VermaSh This one resolves the blocker right ? Can we update the Commit message to reflect that ?

@zl-wang Ping to see if you have any recommendation for Shubham's PR reverting the checks that was removed accidentally.

@VermaSh
Copy link
Contributor Author

VermaSh commented Jul 16, 2024

Yup, from my testing this does fix failure . I have updated the PR description to reflect that.

@VermaSh
Copy link
Contributor Author

VermaSh commented Jul 16, 2024

All windows machines are still offline because they can't access github.com (issue).

Copy link
Contributor

@zl-wang zl-wang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@r30shah
Copy link
Contributor

r30shah commented Jul 17, 2024

As changes are approved and testing has done to satisfactory level, merging this change.

@r30shah r30shah merged commit 91e4073 into eclipse-openj9:master Jul 17, 2024
26 of 29 checks passed
@VermaSh VermaSh deleted the daa_failure branch July 17, 2024 14:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

DaaLoadTest_daa1 BigInteger would overflow supported range
3 participants