JDK-8273496 : Make sure that CCP adds nodes to the IGVN worklist
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 18,21,23
  • Priority: P3
  • Status: Open
  • Resolution: Unresolved
  • Submitted: 2021-09-08
  • Updated: 2024-03-28
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 :  
Relates :  
Relates :  
Description
To avoid issues like JDK-8273409, we need to make sure that all nodes that might benefit from an input node with a more precise type should be added to the IGVN worklist.

Current code has a "TEMPORARY fix" comment at the corresponding location:
https://github.com/openjdk/jdk/blob/4023646ed1bcb821b1d18f7e5104f04995e8171d/src/hotspot/share/opto/phaseX.cpp#L1968
Comments
At some point I needed the following hack in Valhalla: diff --git a/src/hotspot/share/opto/phaseX.cpp b/src/hotspot/share/opto/phaseX.cpp index 8f9acc6e827..24fb33ecd23 100644 --- a/src/hotspot/share/opto/phaseX.cpp +++ b/src/hotspot/share/opto/phaseX.cpp @@ -2208,6 +2208,14 @@ Node *PhaseCCP::transform_once( Node *n ) { _worklist.push(n); // n re-enters the hash table via the worklist } + if (n->is_Load()) { + Node* ld_adr = n->in(MemNode::Address); + // PhaseCCP might enable MemNode::can_see_stored_value() for LoadNodes, put the Load on the IGVN worklist to allow LoadNode::Ideal to fold it + if (type(ld_adr)->is_inlinetypeptr()) { + _worklist.push(n); + } + } + // TEMPORARY fix to ensure that 2nd GVN pass eliminates null checks switch( n->Opcode() ) { case Op_CallStaticJava: // Give post-parse call devirtualization a chance I could later remove the code again because the code shape did not show up anymore but I'm sure the problem persists. It should be fixed in mainline.
27-03-2024