JDK-8361144 : Strenghten the Ideal Verification in PhaseIterGVN::verify_Ideal_for by comparing the hash of a node before and after Ideal
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 26
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2025-07-01
  • Updated: 2025-07-17
  • Resolved: 2025-07-14
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 26
26 b07Fixed
Related Reports
Relates :  
Relates :  
Description
In PhaseIterGVN::verify_Ideal_for, the Ideal method is called for a given node to assert that no further optimization can be done.  According to the comments in node.cpp, if any change is made by Ideal, it must return the root of the reshaped graph.

For this reason, we check the return value of Ideal and only flag a missed optimization if it is not nullptr. However, since this runs in a verification context, we should not fully rely on the assumption that Ideal always adheres to this contract and we should also verify it.

To strengthen the verification, we could compute the hash of the node before calling Ideal, then recompute and compare it afterward to detect any unexpected changes to the structure of the graph.
Comments
Changeset: a531c9ae Branch: master Author: BenoƮt Maillard <bmaillard@openjdk.org> Committer: Damon Fenacci <dfenacci@openjdk.org> Date: 2025-07-14 11:40:00 +0000 URL: https://git.openjdk.org/jdk/commit/a531c9aece200d27d7870595eee8e14e39e9bd00
14-07-2025

A pull request was submitted for review. Branch: master URL: https://git.openjdk.org/jdk/pull/26064 Date: 2025-07-01 11:35:06 +0000
01-07-2025