RFR: 8351468: C2: array fill optimization assigns wrong type to intrinsic call

Roberto Castañeda Lozano rcastanedalo at openjdk.org
Wed Mar 12 14:35:57 UTC 2025


On Wed, 12 Mar 2025 10:22:15 GMT, Quan Anh Mai <qamai at openjdk.org> wrote:

> I think the issue here is the implementation of `MemNode::memory_type()`.

I agree, in particular the fact that `StoreC` nodes are used to represent both `short` and `char` stores but always return `T_CHAR` as their `memory_type()`. That is why I propose to simply circumvent the usage of `MemNode::memory_type()` to compute the type of the array fill intrinsic in this changeset, and explore creating a dedicated `StoreS` node in a separate RFE.

> what if I `StoreC` to a `long[]`?

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?

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

PR Comment: https://git.openjdk.org/jdk/pull/24005#issuecomment-2718102394


More information about the hotspot-compiler-dev mailing list