RFR: 8345485: C2 MergeLoads: merge adjacent array/native memory loads into larger load [v4]
kuaiwei
duke at openjdk.org
Tue Mar 18 09:17:12 UTC 2025
On Tue, 18 Mar 2025 08:52:09 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 1896:
>
>> 1894: LowToHigh, // Adjacent and first load access low address
>> 1895: HighToLow, // Adjacent and first load access high address
>> 1896: NotAdjacent // Not adjacent
>
> What happens if an `OrNode` has its inputs swapped? This can happen if the node idx are the "wrong way around". See `commute`, comment `Otherwise, sort inputs (commutativity) to help value numbering`.
>
> I don't know how likely this is to happen. What do you think?
I think it's ok to swap. I collected merged mem info and sorted them by shift value. Then check the memory order. So if shift order follows memory access order (or reverse), they can be merged.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/24023#discussion_r2000553715
More information about the hotspot-compiler-dev
mailing list