[all-commits] [llvm/llvm-project] 1919db: [mlir][vector] Clarify the semantics of BroadcastO...

Andrzej Warzyński via All-commits all-commits at lists.llvm.org
Thu Aug 8 01:11:40 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 1919db907bc3e0541839992d903b6b875da98b04
      https://github.com/llvm/llvm-project/commit/1919db907bc3e0541839992d903b6b875da98b04
  Author: Andrzej Warzyński <andrzej.warzynski at arm.com>
  Date:   2024-08-08 (Thu, 08 Aug 2024)

  Changed paths:
    M mlir/include/mlir/Dialect/Vector/IR/VectorOps.h
    M mlir/include/mlir/Dialect/Vector/IR/VectorOps.td
    M mlir/lib/Dialect/Vector/IR/VectorOps.cpp
    M mlir/test/Dialect/Vector/invalid.mlir

  Log Message:
  -----------
  [mlir][vector] Clarify the semantics of BroadcastOp (#101928)

Clarifies the semantics of `vector.broadcast` in the context of scalable
vectors. In particular, broadcasting a unit scalable dim, `[1]`, is not
valid unless there's a match between the output and the input dims.
See the examples below for an illustration:

```mlir
// VALID
 %0 = vector.broadcast %arg0 : vector<[1]xf32> to vector<4x[1]xf32>
// INVALID
 %0 = vector.broadcast %arg0 : vector<[1]xf32> to vector<[4]xf32>
// VALID FIXED-WIDTH EQUIVALENT
 %0 = vector.broadcast %arg0 : vector<1xf32> to vector<4xf32>
```

Documentation, the Op verifier and tests are updated accordingly.



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