RFR: 8345485: C2 MergeLoads: merge adjacent array/native memory loads into larger load [v4]

kuaiwei duke at openjdk.org
Mon Apr 28 13:44:56 UTC 2025


On Tue, 18 Mar 2025 08:43:23 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 1877:
> 
>> 1875:                                                            _last_op(false) {}
>> 1876:   void set_last_op(bool v)            { _last_op = v; }
>> 1877:   bool last_op()                const { return _last_op; }
> 
> Is it feasible to make all fields `const`? It can often make reasoning about code easier if you know that there can be no modifications. Not sure about `_last_op`, I'll have to keep reading to find out.

When I change MergeLoadInfoList as GrowableArray<MergeLoadInfo>, I need copy info into array, I added `operator=` and copy constructor. So these fields can not be const.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/24023#discussion_r2063685689


More information about the hotspot-compiler-dev mailing list