RFR: 8336245: AArch64: remove extra register copy when converting from long to pointer
Andrew Haley
aph at openjdk.org
Thu Jul 25 13:41:33 UTC 2024
On Thu, 25 Jul 2024 10:47:41 GMT, Andrew Dinn <adinn at openjdk.org> wrote:
> The change allows immLOffset to be used in the definition of indOffX2P. I am not clear why indOffX2P is not just defined using the existing operand immLoffset16 which has as its predicate Address::offset_ok_for_immed(n->get_long(), 4).
After this change, `immLOffset` is a more general-purpose type than `immLoffset16`. `immLOffset` matches all possible address offsets, along with some impossible ones. For example, it matches all of the misaligned `Unsafe` accesses at any offset, regardless of operand size. In the (rare) event that an operand size and offset don't fit a single instruction, we'll split the instruction when we emit it.
After this patch there will be a few rare cases where we have a regression in code size, but it's worth it for the simplicity and the size of the matcher logic, which would otherwise explode. I don't expect any significant regression in execution time.
This patch is not the last word on the matter; later patches may well further reduce the number of integer offset types in a similar way. I don't think that many of the offsetL/I/X/P types do anything useful, and we'd probably profit from removing them, but that's another patch for anther day.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/20157#discussion_r1691462027
More information about the hotspot-dev
mailing list