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

Vladimir Kozlov kvn at openjdk.org
Tue Feb 27 19:30:54 UTC 2024


On Tue, 27 Feb 2024 17:37:07 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 incrementally with one additional commit since the last revision:
> 
>   Update LoopArrayIndexComputeTest.java copyright year

My suggestion for comments about PopulateIndex skipping

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

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


More information about the hotspot-compiler-dev mailing list