JDK-8286622 : C2: pre-schedule initially-ready CreateEx nodes in LCM
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 19
  • Priority: P4
  • Status: Open
  • Resolution: Unresolved
  • Submitted: 2022-05-12
  • Updated: 2025-02-25
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 :  
Description
CreateEx nodes that are initially ready in LCM (that is, do not have any input dependency in their basic block) must be scheduled at the beginning of their block, right after Phi and Parm nodes. This is currently enforced by placing them at the beginning of the initial ready list [1] so that they are selected before any other node [2]. Relying on the order of the ready list for correctness is fragile, and forces a tie between projections and other CreateEx nodes that are not initially ready in LCM node selection [2]. This tie can potentially lead to projections not being scheduled next to their parents, thus breaking an invariant of LCM [3].

A more robust solution would be to pre-schedule CreateEx nodes that are initially ready in a similar manner to how Phi and Parm nodes are handled, and break the tie between projections and other CreateEx nodes in favor of projections.

[1] https://github.com/openjdk/jdk/blob/89392fb15e9652b7b562b3511f79bda725c5499c/src/hotspot/share/opto/lcm.cpp#L1079-L1082
[2] https://github.com/openjdk/jdk/blob/89392fb15e9652b7b562b3511f79bda725c5499c/src/hotspot/share/opto/lcm.cpp#L534-L542
[3] https://github.com/openjdk/jdk/blob/89392fb15e9652b7b562b3511f79bda725c5499c/src/hotspot/share/opto/block.cpp#L1277-L1278