RFR: 8308994: C2: Re-implement experimental post loop vectorization [v2]
Emanuel Peter
epeter at openjdk.org
Mon Jul 3 15:01:21 UTC 2023
On Mon, 3 Jul 2023 08:36:44 GMT, Pengfei Li <pli at openjdk.org> wrote:
>> src/hotspot/share/opto/vmaskloop.cpp line 104:
>>
>>> 102: _core_set.clear();
>>> 103: _body_set.clear();
>>> 104: _body_nodes.clear();
>>
>> Would it make sense to somehow reserve the space, so that we do not allocate multiple times when growing these data structures later?
>
> Could you elaborate how to do such reservation in C2? Just allocation with some larger sizes at the beginning? Or any other examples to refer?
I think what I have seen people do is just to `map` a high enough index value with `nullptr`. A bit hacky, but it ensures that the arrays underneath get grown sufficiently immediately. It would be nice to have some kind of `reserve` methods... but I don't think we have that.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/14581#discussion_r1251002205
More information about the hotspot-compiler-dev
mailing list