[all-commits] [llvm/llvm-project] 0ea127: [mlir][vector] Add support for unrolling vector.bi...

Han-Chung Wang via All-commits all-commits at lists.llvm.org
Mon Jun 3 16:40:14 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 0ea1271ee13c8c3d765904dba16dd27b91584d66
      https://github.com/llvm/llvm-project/commit/0ea1271ee13c8c3d765904dba16dd27b91584d66
  Author: Han-Chung Wang <hanhan0912 at gmail.com>
  Date:   2024-06-03 (Mon, 03 Jun 2024)

  Changed paths:
    M mlir/include/mlir/Dialect/Vector/TransformOps/VectorTransformOps.td
    M mlir/include/mlir/Dialect/Vector/Transforms/LoweringPatterns.h
    M mlir/lib/Conversion/VectorToLLVM/ConvertVectorToLLVMPass.cpp
    M mlir/lib/Dialect/Vector/TransformOps/VectorTransformOps.cpp
    M mlir/lib/Dialect/Vector/Transforms/CMakeLists.txt
    A mlir/lib/Dialect/Vector/Transforms/LowerVectorBitCast.cpp
    M mlir/test/Conversion/VectorToLLVM/vector-to-llvm.mlir
    A mlir/test/Dialect/Vector/vector-bitcast-lowering-transforms.mlir

  Log Message:
  -----------
  [mlir][vector] Add support for unrolling vector.bitcast ops. (#94064)

The revision unrolls vector.bitcast like:

```mlir
%0 = vector.bitcast %arg0 : vector<2x4xi32> to vector<2x2xi64>
```

to

```mlir
%cst = arith.constant dense<0> : vector<2x2xi64>
%0 = vector.extract %arg0[0] : vector<4xi32> from vector<2x4xi32>
%1 = vector.bitcast %0 : vector<4xi32> to vector<2xi64>
%2 = vector.insert %1, %cst [0] : vector<2xi64> into vector<2x2xi64>
%3 = vector.extract %arg0[1] : vector<4xi32> from vector<2x4xi32>
%4 = vector.bitcast %3 : vector<4xi32> to vector<2xi64>
%5 = vector.insert %4, %2 [1] : vector<2xi64> into vector<2x2xi64>
```

The scalable vector is not supported because of the limitation of
`vector::createUnrollIterator`. The targetRank could mismatch the final
rank during unrolling; there is no direct way to query what the final
rank is from the object.



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