RFR: 8347006: LoadRangeNode floats above array guard in arraycopy intrinsic [v4]

Tobias Hartmann thartmann at openjdk.org
Fri Jan 10 07:08:51 UTC 2025


On Thu, 9 Jan 2025 16:28:46 GMT, Vladimir Kozlov <kvn at openjdk.org> wrote:

>> Tobias Hartmann has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Copyright date
>
> src/hotspot/share/opto/library_call.cpp line 4307:
> 
>> 4305:     // Keep track of the fact that 'obj' is an array to prevent
>> 4306:     // array specific accesses from floating above the guard.
>> 4307:     *obj = _gvn.transform(new CastPPNode(is_array_ctrl, *obj, TypeAryPtr::BOTTOM));
> 
> Should we do this for above code when layout is known for compiler (`layout_con` is checked)?

I thought about this as well but I don't think it's necessary because:
- No cast is needed if we know the type already
- We don't emit a guard and only one branch remains, so there is no risk of the array specific access floating above

So I went with the simplest changes for now, also since we need to backport this change (it got already much more complicated than I was aiming for).

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

PR Review Comment: https://git.openjdk.org/jdk/pull/22967#discussion_r1909916119


More information about the graal-dev mailing list