JDK-8298094 : Refactor PhaseCCP and IGVN notification
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 20
  • Priority: P4
  • Status: Open
  • Resolution: Unresolved
  • Submitted: 2022-12-05
  • Updated: 2022-12-16
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.
Other
tbdUnresolved
Related Reports
Relates :  
Relates :  
Description
Both CCP and IGVN need to notify outputs if an input has been updated, so that the optimization can propagate down. But we currently have two different implementations for that:
PhaseCCP::push_child_nodes_to_worklist
PhaseIterGVN::add_users_to_worklist

To some degree this makes sense, since there are slight variations. And we want to notify as little as possible. On the other hand, the code is a bit messy, and just grows as we discover more bugs. Plus, usually people will miss that they have to change one of the two, and probably are not aware that they need to change both.

Suggestion: refactor by implementing it as a virtual method of Node, and have phase as parameter. Chose behaviour based on phase: IGVN will probably notify more than CCP (subset, because only runs Value, not Ideal and Identity). The virtual member function makes it more OOP, and removes all of the type checks we are currently doing.