RFR: 8318446: C2: optimize stores into primitive arrays by combining values into larger store [v17]

Emanuel Peter epeter at openjdk.org
Thu Mar 7 06:58:58 UTC 2024


On Wed, 6 Mar 2024 08:52:16 GMT, Roland Westrelin <roland at openjdk.org> wrote:

>> Emanuel Peter has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   a little bit of casting for debug printing code
>
> src/hotspot/share/opto/memnode.cpp line 3154:
> 
>> 3152:     }
>> 3153:     ProjNode* other_proj = ctrl_s1->as_IfProj()->other_if_proj();
>> 3154:     if (other_proj->is_uncommon_trap_proj(Deoptimization::Reason_range_check) == nullptr ||
> 
> This could be a range check for an unrelated array I suppose. Does it matter?

I don't think it matters, no. Do you see a scenario where it would matter?

My argument:
It is safe to do the stores after the RC rather than before it. And if the RC trap relies on the memory state of the stores that were before the RC, then those stores simply don't lose all their uses, and stay in the graph.
After all, we only remove the "last" store by replacing it with the merged store, so the other stores only disappear if they have no other use.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/16245#discussion_r1515632976


More information about the hotspot-compiler-dev mailing list