[all-commits] [llvm/llvm-project] da37c7: [mlir][vector] Add a check to ensure input vector ...

Prakhar Dixit via All-commits all-commits at lists.llvm.org
Tue Feb 25 17:39:47 PST 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: da37c76ac621c64216e56ead3efe1bd569250ee2
      https://github.com/llvm/llvm-project/commit/da37c76ac621c64216e56ead3efe1bd569250ee2
  Author: Prakhar Dixit <75660779+Prakhar-Dixit at users.noreply.github.com>
  Date:   2025-02-26 (Wed, 26 Feb 2025)

  Changed paths:
    M mlir/lib/Dialect/Vector/Transforms/VectorUnroll.cpp
    M mlir/test/Dialect/Vector/vector-unroll-options.mlir

  Log Message:
  -----------
  [mlir][vector] Add a check to ensure input vector rank equals target shape rank (#127706)

Fixes issue #126197

The crash is caused because, during IR transformation, the
vector-unrolling pass (using ExtractStridedSliceOp) attempts to slice an
input vector of higher rank using a target vector of lower rank, which
is not supported.

Specific example :
```
module {
  func.func @func1() {
    %cst_25 = arith.constant dense<3.718400e+04> : vector<4x2x2xf16>
    %cst_26 = arith.constant dense<1.000000e+00> : vector<24x2x2xf32>
    %47 = vector.fma %cst_26, %cst_26, %cst_26 : vector<24x2x2xf32>
    %818 = scf.execute_region -> vector<24x2x2xf32> {
        scf.yield %47 : vector<24x2x2xf32>
      }
    %823 = vector.extract_strided_slice %cst_25 {offsets = [2], sizes = [1], strides = [1]} : vector<4x2x2xf16> to vector<1x2x2xf16>
    return
  }
}
```

---------

Co-authored-by: Kai Sasaki <lewuathe at gmail.com>



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