RFR: 8362504: AArch64: Replace MOVZ+MOVK+MOVK with ADRP+ADD

Andrew Dinn adinn at openjdk.org
Wed Aug 20 14:34:40 UTC 2025


On Wed, 20 Aug 2025 14:07:42 GMT, Fei Gao <fgao at openjdk.org> wrote:

>>> > In short, in "production" run we need to know what code we are working on/patching: AOTed or normal JITed.
>>> 
>>> Or code should be the same.
>> 
>> OK, so we should not commit this patch. it's not worth it.
>
>> > In short, in "production" run we need to know what code we are working on/patching: AOTed or normal JITed.
>> 
>> Or code should be the same.
> 
> Would it make sense to disable the reachability-based optimization when `AOTCodeCache::is_on()` returns true?
> In this case, we would always emit `mov` triples for foreign calls if AoT is involved, whether dumping or using the AoT code cache.
> 
> For calls that must relocate into the code cache, we already always emit `adrp + add`, ensuring consistent behavior regardless of whether the code is AOT-compiled or JIT-compiled.
> 
> What do you think? Thanks!

@fg1417
> Would it make sense to disable the reachability-based optimization when AOTCodeCache::is_on() returns true?

If we were to proceed with this patch then yes I guess that would be the easiest way to proceed.

However, @theRealAph's argument was that we should not proceed with this optimization because it adds extra code complexity (i.e. a maintenance burden) with no guarantee of a noticeable performance gain. I agree with that argument. Bypassing the optimization in the AOT case does not help to reduce complexity or improve the performance so it does not change that argument.

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

PR Comment: https://git.openjdk.org/jdk/pull/26653#issuecomment-3206673353


More information about the hotspot-dev mailing list