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

8252583: Clean up unused phi-to-copy degradation mechanism #275

Closed
wants to merge 6 commits into from

Conversation

robcasloz
Copy link
Contributor

@robcasloz robcasloz commented Sep 21, 2020

Remove unused notion of "PhiNode-to-copy degradation", where PhiNodes can be degraded to copies by setting their RegionNode to NULL. Remove corresponding PhiNode::is_copy() test, which always returned NULL (false). Assert that PhiNodes have an associated RegionNode in PhiNode::Ideal().


Progress

  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • Change must be properly reviewed

Issue

  • JDK-8252583: Clean up unused phi-to-copy degradation mechanism

Reviewers

Download

$ git fetch https://git.openjdk.java.net/jdk pull/275/head:pull/275
$ git checkout pull/275

Convert PhiNode::is_copy() into an actual, debug-only predicate. Replace calls
to is_copy() from non-debug code with explicit assertions. Remove dead loop in
debug-only MergeMemStream::match_memory().
@bridgekeeper
Copy link

bridgekeeper bot commented Sep 21, 2020

👋 Welcome back robcasloz! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@robcasloz
Copy link
Contributor Author

/summary
Convert PhiNode::is_copy() into an actual, debug-only predicate. Replace calls
to is_copy() from non-debug code with explicit assertions. Remove dead loop in
debug-only MergeMemStream::match_memory().

@openjdk
Copy link

openjdk bot commented Sep 21, 2020

@robcasloz Setting summary to:

Convert PhiNode::is_copy() into an actual, debug-only predicate. Replace calls
to is_copy() from non-debug code with explicit assertions. Remove dead loop in
debug-only MergeMemStream::match_memory().

@openjdk
Copy link

openjdk bot commented Sep 21, 2020

@robcasloz The following label will be automatically applied to this pull request: hotspot-compiler.

When this pull request is ready to be reviewed, an RFR email will be sent to the corresponding mailing list. If you would like to change these labels, use the /label (add|remove) "label" command.

@openjdk openjdk bot added the hotspot-compiler hotspot-compiler-dev@openjdk.org label Sep 21, 2020
@robcasloz robcasloz marked this pull request as ready for review September 21, 2020 06:31
@openjdk openjdk bot added the rfr Pull request is ready for review label Sep 21, 2020
@mlbridge
Copy link

mlbridge bot commented Sep 21, 2020

Webrevs

src/hotspot/share/opto/addnode.cpp Outdated Show resolved Hide resolved
src/hotspot/share/opto/addnode.cpp Outdated Show resolved Hide resolved
@robcasloz
Copy link
Contributor Author

Thanks Nils! I just updated the pull request.

src/hotspot/share/opto/memnode.cpp Outdated Show resolved Hide resolved
src/hotspot/share/opto/loopnode.cpp Outdated Show resolved Hide resolved
src/hotspot/share/opto/addnode.cpp Outdated Show resolved Hide resolved
src/hotspot/share/opto/addnode.cpp Outdated Show resolved Hide resolved
@vnkozlov
Copy link
Contributor

Sorry, I am not sure this is better than original code where assert is in one place - in PhiNode::is_copy().
The method is in .hpp file and is inlined - NULL check will be eliminated. It will only be executed in slowdebug build.
May be we should "bite the bullet" and remove this method at all - we don't hit the assert in years.
We can replace is_copy() check with assert in PhiNode::Ideal() - that should be enough to guarantee that we don't create Phi with NULL control edge.

@navyxliu
Copy link
Member

navyxliu commented Sep 22, 2020

Sorry, I am not sure this is better than original code where assert is in one place - in PhiNode::is_copy().
The method is in .hpp file and is inlined - NULL check will be eliminated. It will only be executed in slowdebug build.
May be we should "bite the bullet" and remove this method at all - we don't hit the assert in years.
We can replace is_copy() check with assert in PhiNode::Ideal() - that should be enough to guarantee that we don't create Phi with NULL control edge.

Another thing is that a node has a member called uint Node::is_Copy() const. PhiNode/Region nodes both have a member callled "is_copy()". Is it intentional? IMHO, it's not good in style.

@robcasloz
Copy link
Contributor Author

Thanks Tobias and Xin for the reviews! I updated the PR for the record, even if we might end up moving the assertions somewhere else as per Vladimir's suggestion.

Remove unused notion of 'PhiNode-to-copy degradation', where PhiNodes can be
degraded to copies by setting their RegionNode to NULL. Remove corresponding
PhiNode::is_copy() test, which always returned NULL (false). Assert that
PhiNodes have an associated RegionNode in PhiNode::Ideal().
@robcasloz robcasloz changed the title 8252583: Make PhiNode::is_copy() debug only 8252583: Clean up unused phi-to-copy degradation mechanism Sep 22, 2020
@robcasloz
Copy link
Contributor Author

/summary
Remove unused notion of 'PhiNode-to-copy degradation', where PhiNodes can be
degraded to copies by setting their RegionNode to NULL. Remove corresponding
PhiNode::is_copy() test, which always returned NULL (false). Assert that
PhiNodes have an associated RegionNode in PhiNode::Ideal().

@openjdk
Copy link

openjdk bot commented Sep 22, 2020

@robcasloz Updating existing summary to:

Remove unused notion of 'PhiNode-to-copy degradation', where PhiNodes can be
degraded to copies by setting their RegionNode to NULL. Remove corresponding
PhiNode::is_copy() test, which always returned NULL (false). Assert that
PhiNodes have an associated RegionNode in PhiNode::Ideal().

@robcasloz
Copy link
Contributor Author

Tested successfully on hs-tier1, hs-tier2, and hs-tier3.

Copy link
Contributor

@vnkozlov vnkozlov left a comment

Choose a reason for hiding this comment

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

Good.

@openjdk
Copy link

openjdk bot commented Sep 22, 2020

@robcasloz This change now passes all automated pre-integration checks.

ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for more details.

After integration, the commit message for the final commit will be:

8252583: Clean up unused phi-to-copy degradation mechanism

Remove unused notion of 'PhiNode-to-copy degradation', where PhiNodes can be
degraded to copies by setting their RegionNode to NULL. Remove corresponding
PhiNode::is_copy() test, which always returned NULL (false). Assert that
PhiNodes have an associated RegionNode in PhiNode::Ideal().

Reviewed-by: thartmann, kvn

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 39 new commits pushed to the master branch:

  • 4440bda: 8219586: CodeHeap State Analytics processes dead nmethods
  • 154b8cf: 8253014: OopStorage bulk release logs entries multiple times
  • ba174af: 8253048: AArch64: When CallLeaf, no need to preserve callee-saved registers in caller
  • 3320fc0: 8253372: [TESTBUG] update tests which require jvmti - hotspot
  • f765a7f: 8252712: move doclint to jdk.javadoc module
  • c21690b: 8253464: ARM32 Zero: atomic_copy64 is incorrect, breaking volatile stores
  • 0bc01da: 8250635: MethodArityHistogram should use Compile_lock in favour of fancy checks
  • 812b39f: 8252739: Deflater.setDictionary(byte[], int off, int len) ignores the starting offset for the dictionary
  • 5f1d612: 8253397: Ensure LogTag types are sorted
  • b8ea80a: 8253457: Remove unimplemented register stack functions
  • ... and 29 more: https://git.openjdk.java.net/jdk/compare/2e30ff61b0394793655d6c6a593a5de8eb9c07b9...master

As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details.

As you do not have Committer status in this project an existing Committer must agree to sponsor your change. Possible candidates are the reviewers of this PR (@neliasso, @TobiHartmann, @vnkozlov) but any other Committer may sponsor as well.

➡️ To flag this PR as ready for integration with the above commit message, type /integrate in a new comment. (Afterwards, your sponsor types /sponsor in a new comment to perform the integration).

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Sep 22, 2020
Copy link
Member

@TobiHartmann TobiHartmann left a comment

Choose a reason for hiding this comment

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

Looks good to me.

@robcasloz
Copy link
Contributor Author

Looks good to me.

Thanks Tobias!

@openjdk openjdk bot removed the ready Pull request is ready to be integrated label Sep 23, 2020
@openjdk openjdk bot removed the rfr Pull request is ready for review label Sep 23, 2020
@openjdk openjdk bot added ready Pull request is ready to be integrated rfr Pull request is ready for review labels Sep 24, 2020
@robcasloz
Copy link
Contributor Author

/integrate

@openjdk openjdk bot added the sponsor Pull request is ready to be sponsored label Sep 24, 2020
@openjdk
Copy link

openjdk bot commented Sep 24, 2020

@robcasloz
Your change (at version b7656e1) is now ready to be sponsored by a Committer.

@TobiHartmann
Copy link
Member

/sponsor

@openjdk openjdk bot closed this Sep 24, 2020
@openjdk openjdk bot added integrated Pull request has been integrated and removed sponsor Pull request is ready to be sponsored ready Pull request is ready to be integrated rfr Pull request is ready for review labels Sep 24, 2020
@openjdk
Copy link

openjdk bot commented Sep 24, 2020

@TobiHartmann @robcasloz Since your change was applied there have been 39 commits pushed to the master branch:

  • 4440bda: 8219586: CodeHeap State Analytics processes dead nmethods
  • 154b8cf: 8253014: OopStorage bulk release logs entries multiple times
  • ba174af: 8253048: AArch64: When CallLeaf, no need to preserve callee-saved registers in caller
  • 3320fc0: 8253372: [TESTBUG] update tests which require jvmti - hotspot
  • f765a7f: 8252712: move doclint to jdk.javadoc module
  • c21690b: 8253464: ARM32 Zero: atomic_copy64 is incorrect, breaking volatile stores
  • 0bc01da: 8250635: MethodArityHistogram should use Compile_lock in favour of fancy checks
  • 812b39f: 8252739: Deflater.setDictionary(byte[], int off, int len) ignores the starting offset for the dictionary
  • 5f1d612: 8253397: Ensure LogTag types are sorted
  • b8ea80a: 8253457: Remove unimplemented register stack functions
  • ... and 29 more: https://git.openjdk.java.net/jdk/compare/2e30ff61b0394793655d6c6a593a5de8eb9c07b9...master

Your commit was automatically rebased without conflicts.

Pushed as commit f3ea0d3.

💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hotspot-compiler hotspot-compiler-dev@openjdk.org integrated Pull request has been integrated
5 participants