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

Guarantee functional correctness of rdbar/wrtbar #4009

Merged
merged 1 commit into from
Jan 7, 2019

Conversation

cathyzhyi
Copy link
Contributor

This change guarantees the correctness of rdbar/wrtbar from the following
aspects:

  1. Consider rdbar/wrtbar as GC points
  2. Make optimizations consider shape of rdbar/wrtbar when doing
    transformations
  3. Disable opts not supporting newly added rdbar/wrtbar when seeing
    the opcodes

Signed-off-by: Yi Zhang yizhang@ca.ibm.com

@cathyzhyi cathyzhyi changed the title Guarantee functional correctness of rdbar/wrtbar WIP: Guarantee functional correctness of rdbar/wrtbar Dec 12, 2018
@cathyzhyi cathyzhyi changed the title WIP: Guarantee functional correctness of rdbar/wrtbar Guarantee functional correctness of rdbar/wrtbar Dec 12, 2018
// 1. In Guarded Storage, we can't not do a guarded load because the object that is loaded may
// not be in the root set, and as a consequence, may get moved.
// 2. For read barriers, the vmhelpers are GC points and therefore the object might be moved
if (TR::Compiler->om.shouldGenerateReadBarriersForFieldLoads() || generateReadBarrier)
Copy link
Contributor

Choose a reason for hiding this comment

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

why isn't the first part of this || part of the bool added above? it would seem you would have to repeat this idiom no? Doesn't this warrant a trace statement of some kind to say we disabling because of 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.

Cleaned up the bool and condition. Added tracing as well.

@@ -2302,6 +2302,9 @@ TR_CISCNode *
TR_CISCTransformer::addAllSubNodes(TR_CISCGraph *const graph, TR::Block *const block, TR::TreeTop *const top,
TR::Node *const parent, TR::Node *const node, const int32_t dagId)
{
//IdiomRecognition doesn't know how to handle rdbar/wrtbar for now
if ((node->getOpCode().isReadBar() || node->getOpCode().isWrtBar()) && comp()->incompleteOptimizerSupportForReadWriteBarriers())
Copy link
Contributor

Choose a reason for hiding this comment

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

can we reverse the order of the && to make this more clear and break onto a new line at the && so it looks more like

       && (node->getOpCode().isReadBar() || node->getOpCode().isWrtBar()))

Copy link
Contributor Author

Choose a reason for hiding this comment

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

changed according to the comment. Thanks!

@andrewcraik
Copy link
Contributor

Once the final code formatting issue is sorted I think this will be good to test and merge.

@cathyzhyi cathyzhyi force-pushed the functional branch 2 times, most recently from 03bdb7b to 9485589 Compare January 4, 2019 04:21
This change guarantee the correctness of rdbar/wrtbar from the following
aspects:
1. Consider rdbar/wrtbar as GC points
2. Make optimizations consider shape of rdbar/wrtbar when doing
transformations
3. Disable opts not supporting newly added rdbar/wrtbar when seeing
the opcodes

Signed-off-by: Yi Zhang <yizhang@ca.ibm.com>
@cathyzhyi
Copy link
Contributor Author

Changed the coding format issue and also added code to disable escape analysis.

@andrewcraik
Copy link
Contributor

Jenkins test sanity xlinux,win,plinux jdk8.jdk11

@andrewcraik
Copy link
Contributor

Jenkins test sanity xlinux,win,plinux jdk8,jdk11

Copy link
Contributor

@andrewcraik andrewcraik left a comment

Choose a reason for hiding this comment

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

LGTM

@andrewcraik
Copy link
Contributor

Failure on x86-64 is DDR related and unrelated to this change- merging

@andrewcraik andrewcraik merged commit 4abcaf7 into eclipse-openj9:master Jan 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants