RFR: 8308994: C2: Re-implement experimental post loop vectorization [v2]
Pengfei Li
pli at openjdk.org
Mon Jul 3 07:59:10 UTC 2023
On Fri, 23 Jun 2023 10:43:34 GMT, Emanuel Peter <epeter at openjdk.org> wrote:
>> Pengfei Li has updated the pull request incrementally with one additional commit since the last revision:
>>
>> Address part of comments from Emanuel
>
> src/hotspot/share/opto/loopnode.hpp line 143:
>
>> 141: if (is_vector_masked()) {
>> 142: return false;
>> 143: }
>
> Does this mean that the post-loop has a `CountedLoop` node, but it does not adhere to the counted-loop assumptions, such as having a `incr`, `limit`, `phi` etc? With the old post-loop-vectorization, the LoopNode would always fold away, so it would disappear after IGVN. But now it would stick around, right? Could that turn out to be a problem?
After being vectorized, the post loop still has `phi`, `incr` and `limit` as before. In other words, the post loop is still a loop now. I think the only difference is that the loop stride value is not a constant any more (as we introduces the `VectorMaskTrueCountNode` for the new stride). The old implementation of post loop vectorization makes the vector-masked post loop run only once so it can optimize the `LoopNode` away. But we cannot do this now without doing multi-versioning. (Without the scalar post loop, loop may run insufficient iterations when the "atomic" post loop is not entered.)
> src/hotspot/share/opto/loopnode.hpp line 775:
>
>> 773:
>> 774: void collect_loop_core_nodes(PhaseIdealLoop* phase, Unique_Node_List& wq) const;
>> 775:
>
> nit: why move it?
This function was private before. I need to make it public so I can use it in `vmaskloop.cpp`.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/14581#discussion_r1250428341
PR Review Comment: https://git.openjdk.org/jdk/pull/14581#discussion_r1250430133
More information about the hotspot-compiler-dev
mailing list