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

C2: Cannot hoist independent load above arraycopy

    XMLWordPrintable

    Details

    • Type: Enhancement
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: 11, 16, 17
    • Fix Version/s: 17
    • Component/s: hotspot
    • Labels:
    • Subcomponent:
    • Resolved In Build:
      b16

      Description

      Hoisting an independent load above an arraycopy fails because L712 in
      MemNode::find_previous_store() cannot be reached:

      https://github.com/openjdk/jdk/blob/72b82fd7be3c8bec97c23d8828fd6bbde03223ce/src/hotspot/share/opto/memnode.cpp#L712

      This is because the call in L709 changes mem but returns NULL in this case when
      it should return != NULL.

      Vladimir K. pointed out that find_previous_arraycopy() originally returned != NULL in this case:

      > Original 8076188 changes returned `ac`:

      > https://github.com/openjdk/jdk/commit/a9cdbd04076149927fc7c13704eb01ea32e2ca6f#diff-819eefad0e0c83dec6968dc3f74924e3cd1763f3a43edf305f37ff591ad9a2feR562

      > but then 8130847 changes accidently removed it when code was refactored:

      > https://github.com/openjdk/jdk/commit/0baf2f7e8ab034548c927857c3182cc949bb225b#diff-819eefad0e0c83dec6968dc3f74924e3cd1763f3a43edf305f37ff591ad9a2feL567

      See also http://mail.openjdk.java.net/pipermail/hotspot-compiler-dev/2021-March/045102.html

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              rrich Richard Reingruber
              Reporter:
              rrich Richard Reingruber
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: