RFR: 8341834: C2 compilation fails with "bad AD file" due to Replicate

Emanuel Peter epeter at openjdk.org
Wed Oct 23 12:24:04 UTC 2024


On Wed, 23 Oct 2024 08:30:15 GMT, Roland Westrelin <roland at openjdk.org> wrote:

> Superword creates a `Replicate` node at a `ConvL2I` node and uses the
> type of the result of the `ConvL2I` to pick the type of the
> `Replicate` instead of the type of the input to the `ConvL2I`.

I found these:


// Java API for Long.bitCount/numberOfLeadingZeros/numberOfTrailingZeros
// returns int type, but Vector API for them returns long type. To unify
// the implementation in backend, AutoVectorization splits the vector
// implementation for Java API into an execution node with long type plus
// another node converting long to int.
bool VectorNode::is_scalar_op_that_returns_int_but_vector_op_returns_long(int opc) {
  switch (opc) {
    case Op_PopCountL:
    case Op_CountLeadingZerosL:
    case Op_CountTrailingZerosL:
      return true;
    default:
      return false;
  }
}


But they are single-input ops, so if they have the same inputs, they would common, and not create a pack with an input replicate node.

Hmm. I tried to play with `MulAddS2I`, but so far no success with getting an example that vectorizes with Replicate...

Do you think there are any other cases than `Conv` where input and output do not match?

-------------

PR Comment: https://git.openjdk.org/jdk/pull/21660#issuecomment-2431946173


More information about the hotspot-compiler-dev mailing list