Skip to content

8361144: Strenghten the Ideal Verification in PhaseIterGVN::verify_Ideal_for by comparing the hash of a node before and after Ideal #26064

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

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

benoitmaillard
Copy link
Contributor

@benoitmaillard benoitmaillard commented Jul 1, 2025

This PR adds a node hash comparison after calling Ideal in PhaseIterGVN::verify_Ideal_for to introduce an additional layer of verification for missed optimizations. Previously, we relied on the return value of Ideal, which is expected to be nullptr if no transformation was done.

By also checking the node's hash before and after Ideal, we could catch inconsistencies in the implementation or unintended modifications to the graph. Both of these may indicate missed or incomplete optimizations.

Testing

Thank you for reviewing!


Progress

  • Change must be properly reviewed (1 review required, with at least 1 Reviewer)
  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue

Issue

  • JDK-8361144: Strenghten the Ideal Verification in PhaseIterGVN::verify_Ideal_for by comparing the hash of a node before and after Ideal (Enhancement - P4)

Reviewers

Contributors

  • Emanuel Peter <epeter@openjdk.org>

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/26064/head:pull/26064
$ git checkout pull/26064

Update a local copy of the PR:
$ git checkout pull/26064
$ git pull https://git.openjdk.org/jdk.git pull/26064/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 26064

View PR using the GUI difftool:
$ git pr show -t 26064

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/26064.diff

Using Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Jul 1, 2025

👋 Welcome back bmaillard! 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.

@openjdk
Copy link

openjdk bot commented Jul 1, 2025

❗ This change is not yet ready to be integrated.
See the Progress checklist in the description for automated requirements.

@openjdk openjdk bot changed the title 8361144 8361144: Strenghten the Ideal Verification in PhaseIterGVN::verify_Ideal_for by comparing the hash of a node before and after Ideal Jul 1, 2025
@openjdk
Copy link

openjdk bot commented Jul 1, 2025

@benoitmaillard 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 pull request command.

@openjdk openjdk bot added the hotspot-compiler hotspot-compiler-dev@openjdk.org label Jul 1, 2025
@benoitmaillard benoitmaillard marked this pull request as ready for review July 1, 2025 11:56
@openjdk openjdk bot added the rfr Pull request is ready for review label Jul 1, 2025
@mlbridge
Copy link

mlbridge bot commented Jul 1, 2025

Webrevs

Copy link
Contributor

@galderz galderz left a comment

Choose a reason for hiding this comment

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

Have you considered adding a test for this? Is that feasible?

Copy link
Contributor

@dafedafe dafedafe left a comment

Choose a reason for hiding this comment

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

Thanks @benoitmaillard! Definitely an additional check worth doing. I left a couple of inline comments.

benoitmaillard and others added 2 commits July 2, 2025 11:59
Co-authored-by: Damon Fenacci <damon.fenacci@oracle.com>
@benoitmaillard
Copy link
Contributor Author

benoitmaillard commented Jul 2, 2025

Have you considered adding a test for this? Is that feasible?

@galderz I have considered doing it, but there is no known case that triggers the condition. This change was suggested by @eme64 when discussing the related JDK-8359602.

@benoitmaillard
Copy link
Contributor Author

/contributor add @eme64

@openjdk
Copy link

openjdk bot commented Jul 2, 2025

@benoitmaillard
Contributor Emanuel Peter <epeter@openjdk.org> successfully added.

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 rfr Pull request is ready for review
Development

Successfully merging this pull request may close these issues.

3 participants