JDK-8257146 : C2: extend the scope of StressGCM
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 16
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • Submitted: 2020-11-26
  • Updated: 2022-11-29
  • Resolved: 2022-11-29
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
tbdResolved
Related Reports
Blocks :  
Blocks :  
Blocks :  
Duplicate :  
Relates :  
Description
Currently, in PhaseCFG::hoist_to_cheaper_block(), StressGCM follows the GCM heuristic when the candidate block has strictly better frequency and only only randomizes tie-breaking among equally frequent blocks:

if (LCA_freq < least_freq              || // Better Frequency
    (StressGCM && C->randomized_select(cand_cnt)) || // Should be randomly accepted in stress mode
    ... 

The randomization scope can be significantly extended by allowing GCM to move instructions to blocks with worse frequency at random:

if ((StressGCM && C->randomized_select(cand_cnt)) || // Should be randomly accepted in stress mode
    (!StressGCM && LCA_freq < least_freq) || // Better Frequency
    ...   

This would improve StressGCM's ability to expose bugs where C2 relies on GCM heuristics for correctness.
Comments
Waiting until JDK-8261236 is addressed.
18-02-2021

Waiting until JDK-8258894 is addressed.
23-12-2020