RFR: 8351468: C2: array fill optimization assigns wrong type to intrinsic call
Roberto Castañeda Lozano
rcastanedalo at openjdk.org
Thu Mar 13 12:34:00 UTC 2025
On Wed, 12 Mar 2025 14:43:15 GMT, Quan Anh Mai <qamai at openjdk.org> wrote:
> > A store of a char value into a long[] array would be represented at the IR level as a conversion (ConvI2L) followed by a StoreL, no?
>
> No, a code such as this `MemorySegment.ofArray(longArray).set(ValueLayout.JAVA_SHORT, offset, c)` would produce a `StoreC` into a `long[]`.
Right, in this case I interpret from the [comment at the declaration of `MemNode::memory_type()`](https://github.com/openjdk/jdk/blob/375722f4ab62865c45d8d76f01dc9c7209be57c8/src/hotspot/share/opto/memnode.hpp#L136) that the `memory_type()` of the StoreC node should be `T_SHORT` (the type of the value stored by the node), as opposed to the current `T_CHAR`. I propose to address this in a separate RFE.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/24005#issuecomment-2721096572
More information about the hotspot-compiler-dev
mailing list