RFR: 8345485: C2 MergeLoads: merge adjacent array/native memory loads into larger load [v4]
kuaiwei
duke at openjdk.org
Tue Mar 18 09:38:10 UTC 2025
On Tue, 18 Mar 2025 08:48:20 GMT, Emanuel Peter <epeter at openjdk.org> wrote:
>> kuaiwei has updated the pull request incrementally with one additional commit since the last revision:
>>
>> Revert extract value and add more tests
>
> src/hotspot/share/opto/memnode.cpp line 1862:
>
>> 1860: /*
>> 1861: * LoadNode and OrNode pair which represent an item for merging,
>> 1862: * And we can get some properties like shift and last_op from it.
>
> To me it seems that `load` and `shift` are the relevant elements here, and the `or` and `last_op` are the "side-info", only used if it is the last op. Is that correct?
The `or` can be used to determine 2 load item are reachable in the `or` chain. After loop unrolling, the code may be like:
((a[0] & 0xff) << 24) | ((a[1] & 0xff) << 16 |((a[2] & 0xff) << 8) | (a[3] & 0xff);
((a[4] & 0xff) << 24) | ((a[5] & 0xff) << 16 |((a[6] & 0xff) << 8) | (a[7] & 0xff);
...
For a given shift value, we may find multiple (load, or) items. We can check reachable of `or` nodes to know which one is relevant.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/24023#discussion_r2000591716
More information about the hotspot-compiler-dev
mailing list