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
8266086: [lworld][lw3] C1 produces incorrect code when GlobalValueNumbering is used #395
Conversation
|
@fparain This change now passes all automated pre-integration checks. After integration, the commit message for the final commit will be:
You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed. At the time when this comment was updated there had been 2 new commits pushed to the
Please see this link for an up-to-date comparison between the source branch of this pull request and the
|
Webrevs
|
@@ -0,0 +1,72 @@ | |||
/* | |||
* Copyright (c) 2020, 2020, Oracle and/or its affiliates. All rights reserved. |
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.
Copyright should be 2021.
/* | ||
* @test | ||
* @summary Test value numbering behaves correctly with flattened fields | ||
* @library /testlibrary /test/lib /compiler/whitebox / |
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.
Whitebox is not used.
* @test | ||
* @summary Test value numbering behaves correctly with flattened fields | ||
* @library /testlibrary /test/lib /compiler/whitebox / | ||
* @compile TestC1ValueNumbering.java |
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.
Not required.
* @summary Test value numbering behaves correctly with flattened fields | ||
* @library /testlibrary /test/lib /compiler/whitebox / | ||
* @compile TestC1ValueNumbering.java | ||
* @run main/othervm -Xcomp -XX:TieredStopAtLevel=1 -ea -XX:+UseGlobalValueNumbering |
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.
UseGlobalValueNumbering
is true by default.
*/ | ||
|
||
public class TestC1ValueNumbering { | ||
static primitive class Point { |
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.
4x whitespace indentation should be used for Java code.
@@ -148,6 +148,9 @@ class ValueNumberingVisitor: public InstructionVisitor { | |||
kill_memory(); | |||
} else { | |||
kill_field(x->field(), x->needs_patching()); | |||
if (x->enclosing_field() != NULL) { | |||
kill_field(x->enclosing_field(), true); |
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.
Why do you need all_offsets == true
? The offset of the enclosing field should always be known, right?
Hi Tobias, Thank you for the review. Regards, Fred |
Thanks for updating, looks good to me!
Best regards,
Tobias
/integrate |
@fparain Since your change was applied there have been 2 commits pushed to the
Your commit was automatically rebased without conflicts. Pushed as commit a7ab3bb. |
Please review this fix in C1 GlobalValueNumbering.
The problem is that C1 doesn't track that a flattened field has been updated when it writes the individual values of this flattened field. The proposed fix is to record the enclosing flattened field with the StoreField node of each individual field, and use this information when the GlobalValueNumbering processes those nodes to kill the flattened field in the ValueMap.
Tested locally (Linux 64) with hotspot_valhalla (including new unit test) and jdk_valhalla test suites.
Thank you,
Fred
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.java.net/valhalla pull/395/head:pull/395
$ git checkout pull/395
Update a local copy of the PR:
$ git checkout pull/395
$ git pull https://git.openjdk.java.net/valhalla pull/395/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 395
View PR using the GUI difftool:
$ git pr show -t 395
Using diff file
Download this PR as a diff file:
https://git.openjdk.java.net/valhalla/pull/395.diff