RFR: 8315361: C2: Create a superclass of SuperWord [v2]
Emanuel Peter
epeter at openjdk.org
Mon Oct 30 11:04:31 UTC 2023
On Wed, 25 Oct 2023 07:11:55 GMT, Fei Gao <fgao at openjdk.org> wrote:
>> As discussed in [JDK-8308994](https://bugs.openjdk.org/browse/JDK-8308994), we should first do some refactoring work before proceeding with the new post loop vectorization. In this patch, we have done the following refactoring. (Most of changes are just moving the code around without real change on logic.)
>>
>> 1) We have created a superclass for shared data structures and utilities for C2's auto-vectorization.
>>
>> 2) We have moved data structures for basic loop info and the field _vector_loop_debug to the superclass. We also drop the class member "_visited" and "_post_visited", and instead use local variables, namely allocating them when using them.
>>
>> 3) Both two vectorizers traverse and store loop body nodes in RPO (Reverse Post-Order) separately. So we withdraw the logic into a new function `collect_nodes_in_reverse_postorder()`, and move the function and related data structures to the superclass. Before, the code for counting the number of reduction uses is mixed in the RPO logic. Now, we have decoupled the code and put it into SuperWord separately.
>>
>> Tested tier1~3 on x86 and AArch64.
>
> Fei Gao has updated the pull request incrementally with one additional commit since the last revision:
>
> Fixed code style and release build failure
Hi @fg1417 I gave it a quick look, generally looks very reasonable.
My question: should we not also move the `velt` (vector element type) and maybe even the dependence graph parts?
If I remember right, then the post-loop-vectorizer also needs some way to determine element type, but not sure about dependence graph. We could also have more classes that have different parts of these features.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/16353#issuecomment-1784950546
More information about the hotspot-compiler-dev
mailing list