JDK-8314997 : Missing optimization opportunities due to missing try_clean_mem_phi() calls
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 17,21,22
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2023-08-25
  • Updated: 2023-09-07
  • Resolved: 2023-09-04
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 22
22 b14Fixed
Related Reports
Relates :  
Description
While working on JDK-8293541 in Valhalla, I've noticed that we are missing try_clean_mem_phi() calls which prevents further optimizations due to not removing a diamond if-region.

The problem is that such a memory phi, which could be optimized by try_clean_mem_phi(), is currently only simplified if the region has exactly one phi. However, in certain IGVN worklist orders we get the following:
1) region is processed which multiple phis
2) the second last phi is removed from the region, only leaving the memory phi to be optimized
3) the memory phi does not make it to the worklist again

A solution could be to either readd the region to the IGVN list or to always transform a memory phi with try_clean_mem_phi() if a region forms a proper diamond.
Comments
Changeset: 2dc930de Author: Christian Hagedorn <chagedorn@openjdk.org> Date: 2023-09-04 06:53:19 +0000 URL: https://git.openjdk.org/jdk/commit/2dc930de12720a1dc27fbbec5a1e161c3699ba79
04-09-2023

A pull request was submitted for review. URL: https://git.openjdk.org/jdk/pull/15445 Date: 2023-08-28 12:38:43 +0000
28-08-2023