JDK-8350756 : C2 SuperWord Multiversioning: remove useless slow loop when the fast loop disappears
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 25
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2025-02-26
  • Updated: 2025-03-21
  • Resolved: 2025-03-06
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 25
25 b14Fixed
Related Reports
Blocks :  
Blocks :  
Causes :  
Duplicate :  
Relates :  
Description
As suggested by [~roland]:

Quote:
Would it be possible and make sense to remove useless slow path loops the way it's done for predicates or zero trip guards? In PhaseIdealLoop::build_loop_late_post_work(), collect all OpaqueMultiversioningNode in a list. Then iterate over all loops the way it's done in PhaseIdealLoop::eliminate_useless_zero_trip_guard(), find loops marked as multi version, check we can get from the loop to the OpaqueMultiversioningNode and mark that one as useful. Eliminate all OpaqueMultiversioningNode not marked as useful. That way if some transformation such as peeling makes the loop non multi version or if the expected shape breaks for some reason, the slow loop is eliminated on next loop opts pass.

More info in the PR discussion here:
https://github.com/openjdk/jdk/pull/22016#issuecomment-2684365921
Comments
Changeset: e82031ec Branch: master Author: Emanuel Peter <epeter@openjdk.org> Date: 2025-03-06 06:48:42 +0000 URL: https://git.openjdk.org/jdk/commit/e82031ec1a8ae2478f83d009594d512a13fdb77e
06-03-2025

A pull request was submitted for review. Branch: master URL: https://git.openjdk.org/jdk/pull/23865 Date: 2025-03-03 13:38:55 +0000
04-03-2025