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

Emanuel Peter epeter at openjdk.org
Wed Feb 28 08:45:20 UTC 2024


> 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:

  Apply suggestions for comments by Vladimir

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

Changes:
  - all: https://git.openjdk.org/jdk/pull/17848/files
  - new: https://git.openjdk.org/jdk/pull/17848/files/dc7ee682..fd4fe607

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=17848&range=04
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=17848&range=03-04

  Stats: 4 lines in 1 file changed: 3 ins; 0 del; 1 mod
  Patch: https://git.openjdk.org/jdk/pull/17848.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/17848/head:pull/17848

PR: https://git.openjdk.org/jdk/pull/17848


More information about the hotspot-compiler-dev mailing list