[all-commits] [llvm/llvm-project] b87a80: [mlir][vector] Add n-d deinterleave lowering (#94237)

Mubashar Ahmad via All-commits all-commits at lists.llvm.org
Fri Jun 7 02:57:22 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: b87a80d4ebca9e1c065f0d2762e500078c4badca
      https://github.com/llvm/llvm-project/commit/b87a80d4ebca9e1c065f0d2762e500078c4badca
  Author: Mubashar Ahmad <mubashar.ahmad at arm.com>
  Date:   2024-06-07 (Fri, 07 Jun 2024)

  Changed paths:
    M mlir/lib/Dialect/Vector/Transforms/LowerVectorInterleave.cpp
    M mlir/test/Conversion/VectorToLLVM/vector-to-llvm.mlir
    A mlir/test/Dialect/Vector/vector-deinterleave-lowering-transforms.mlir

  Log Message:
  -----------
  [mlir][vector] Add n-d deinterleave lowering (#94237)

This patch implements the lowering for vector
deinterleave for vector of n-dimensions. Process
involves unrolling the n-d vector to a series
of one-dimensional vectors. The deinterleave
operation is then used on these vectors.

From:
```
%0, %1 = vector.deinterleave %a : vector<2x8xi8> -> vector<2x4xi8>
```

To:
```
%cst = arith.constant dense<0> : vector<2x4xi32>
%0 = vector.extract %arg0[0] : vector<8xi32> from vector<2x8xi32>
%res1, %res2 = vector.deinterleave %0 : vector<8xi32> -> vector<4xi32>
%1 = vector.insert %res1, %cst [0] : vector<4xi32> into vector<2x4xi32>
%2 = vector.insert %res2, %cst [0] : vector<4xi32> into vector<2x4xi32>
%3 = vector.extract %arg0[1] : vector<8xi32> from vector<2x8xi32>
%res1_0, %res2_1 = vector.deinterleave %3 : vector<8xi32> -> vector<4xi32>
%4 = vector.insert %res1_0, %1 [1] : vector<4xi32> into vector<2x4xi32>
%5 = vector.insert %res2_1, %2 [1] : vector<4xi32> into vector<2x4xi32>
...etc.
```



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list