Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8350756

C2 SuperWord Multiversioning: remove useless slow loop when the fast loop disappears

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Fixed
    • Icon: P4 P4
    • 25
    • 25
    • hotspot
    • master

      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

            epeter Emanuel Peter
            epeter Emanuel Peter
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: