RFR: 8325520: Vector loads with offsets incorrectly compiled [v4]

Damon Fenacci dfenacci at openjdk.org
Thu Apr 25 08:18:31 UTC 2024


On Mon, 15 Apr 2024 08:52:01 GMT, Emanuel Peter <epeter at openjdk.org> wrote:

>> src/hotspot/share/opto/memnode.cpp line 1173:
>> 
>>> 1171:         if (in_vt != out_vt) {
>>> 1172:           return nullptr;
>>> 1173:         }
>> 
>> I see there is a vector type check here. Do we not need that for the code in `StoreNode::Identity`? "Normal" stores like `StoreB` and `StoreI` have the type implicit, but for vector nodes, this type is hidden in the `vect_type()`, so I suspect you need to check it.
>> 
>> I imagine a scenario where we store a float-vector, and then read from the same address as int-vector. Is that ok, or would we need a ReinterpretCast node? I'm not sure, but it would be worth trying to create some tests to check that.
>
> Can you actually do that: store a float-vector to an int-array? Or is that maybe only possible with Unsafe somehow? Or maybe completely impossible?

The API doesn't seem to allow this. I'm not sure of what one could do with Unsafe. Would we have to take potential Unsafe operations into account?

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

PR Review Comment: https://git.openjdk.org/jdk/pull/18347#discussion_r1579068650


More information about the hotspot-compiler-dev mailing list