RFR: 8336245: AArch64: remove extra register copy when converting from long to pointer

Andrew Haley aph at openjdk.org
Mon Jul 15 11:03:51 UTC 2024


On Mon, 15 Jul 2024 10:50:32 GMT, Fei Gao <fgao at openjdk.org> wrote:

>> I think it's the other way around. Isn't this code saying that if the address is an intptr + a nonzero offset, then the returned type is bottom, ie nothing? What effect does this change have?
>
> Thanks for review! Yeah, this code says if the address is an `intptr` + a nonzero offset, then return `TypeRawPtr::BOTTOM`. Then it continues [the verification](https://github.com/openjdk/jdk/blob/a96de6d8d273d75a6500e10ed06faab9955f893b/src/hotspot/share/opto/matcher.cpp#L1834). 
> 
> Without the change here, an `intptr` + a `zero` offset would fail to assert on next lines, https://github.com/openjdk/jdk/blob/a96de6d8d273d75a6500e10ed06faab9955f893b/src/hotspot/share/opto/machnode.cpp#L409-L413
> 
> AFAIK, the return value `TypeRawPtr::BOTTOM` represents `raw access to memory` here. And an `intptr` + a `zero` offset is also a valid `raw access`, so I unblock it here. WDYT? Thanks.

I learn something every day, I guess. It's been a long while since I looked, but I expected "pointer to anything" to be TOP, not BOTTOM. Thinking some more, a `TypeRawPtr` must be casted to a usable physical type in order to use it, so "pointer to nothing" makes more sense than "pointer to anything".

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

PR Review Comment: https://git.openjdk.org/jdk/pull/20157#discussion_r1677648436


More information about the hotspot-dev mailing list