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

[lworld+vector] Enable intrinsification of Unsafe.finishPrivateBuffer.

XMLWordPrintable

      Intrinsification of Unsafe.finishPrivateBuffer was disabled to fix missing inductive InlineType Phi node in loops using Unsafe.put* APIs. Since Unsafe.put* APIs returns a void hence JVM state is not altered and ciTypeFlow during is dataflow analysis does not encounter a inductive definition in the loop.

      We saw performance degradation in some JMH micros using VectorSuffle.fromArray API since its java implementation directly call finishPrivateBuffer.

      In order to maintain IR compliance with ciTypeFlow analysis C2 should prevent scalarizing value object b/w make and finish private buffer.

      New behavior of unsafe inline expanders
      1) makePrivate: Receive InlineTypeNode input and return initialized buffer in larval state.
      2) finishPrivateBuffer: Receive value object buffer input and return rematerialize InlineTypeNode.

      This may result into creation of unbalanced phi node at control flow merges where one of the phi input may InlineTypeNode and other is a buffer of compatible value type, but the IR will still remain valid.

      In addition compiler should prevent elimination of allocation in larval state.

            jbhateja Jatin Bhateja
            jbhateja Jatin Bhateja
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: