RFR: 8326139: C2 SuperWord: split packs (match use/def packs, implemented, mutual independence) [v6]

Vladimir Ivanov vlivanov at openjdk.org
Sat Mar 9 02:37:01 UTC 2024


On Fri, 8 Mar 2024 07:58:22 GMT, Emanuel Peter <epeter at openjdk.org> wrote:

>> After `combine_pairs_to_longer_packs`, we sometimes create packs that are too long and cannot be vectorized.
>> There are multiple reason for that:
>> 
>> - A pack does not "match" with a use of def pack, and we need to split it. Example: split Z:
>> 
>> X X X X Y Y Y Y
>> Z Z Z Z Z Z Z Z
>> 
>> 
>> - A pack is not implemented in the current size, but would be implemented for a smaller size. Some operations are not implemented at max vector size, and we just need to split every pack to the smaller size that is implemented. Or we have a pack of a non-power-of-2 size, and need to split it down into smaller sizes that are power-of-2.
>> 
>> - Packs can have pack internal dependence. This dependence happens at a certain "distance". If we split a pack to be smaller than that "distance", then the internal dependence disappears, and we have the desired mutual independence. Example:
>> https://github.com/openjdk/jdk/blob/9ee274b0480a6e8e399830fd40c34d99c5621c1b/test/hotspot/jtreg/compiler/loopopts/superword/TestSplitPacks.java#L657-L669
>> 
>> Note: Soon I will refactor the packset into a new `PackSet` class, and move the split / filter code there.
>> 
>> **Further Work**
>> 
>> [JDK-8309267](https://bugs.openjdk.org/browse/JDK-8309267) C2 SuperWord: some tests fail on KNL machines - fail to vectorize
>> The issue on KNL machines is that some operations only support vector widths that are smaller than the maximal vector length. Hence, we must split all other vectors that are uses/defs. This change here does exactly that, and so I will be able to put the `UseKNLSetting` in the IRFramework whitelist. I will do that in a separate RFE.
>
> Emanuel Peter has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 33 commits:
> 
>  - Merge branch 'master' into JDK-8309267
>  - Apply suggestions for comments by Vladimir
>  - Update LoopArrayIndexComputeTest.java copyright year
>  - Update src/hotspot/share/opto/superword.cpp
>  - SplitStatus::Kind enum
>  - SplitTask::Kind enum
>  - manual merge
>  - more fixes for TestSplitPacks.java
>  - fix some IR rules in TestSplitPacks.java
>  - fix MulAddS2I
>  - ... and 23 more: https://git.openjdk.org/jdk/compare/de428daf...77e3d47a

Looks good.

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

Marked as reviewed by vlivanov (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/17848#pullrequestreview-1926075988


More information about the hotspot-compiler-dev mailing list