[all-commits] [llvm/llvm-project] 1e61b3: [mlir][vector] Tighten the semantics of vector.gat...

Andrzej Warzyński via All-commits all-commits at lists.llvm.org
Wed Apr 16 04:16:27 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 1e61b374ba3ba2891dc1abda732b0b9263216785
      https://github.com/llvm/llvm-project/commit/1e61b374ba3ba2891dc1abda732b0b9263216785
  Author: Andrzej Warzyński <andrzej.warzynski at arm.com>
  Date:   2025-04-16 (Wed, 16 Apr 2025)

  Changed paths:
    M mlir/include/mlir/Dialect/Vector/IR/VectorOps.td
    M mlir/include/mlir/IR/CommonTypeConstraints.td
    M mlir/test/Dialect/Vector/invalid.mlir

  Log Message:
  -----------
  [mlir][vector] Tighten the semantics of vector.gather (#135749)

This patch restricts `vector.gather` to only accept tensors and memrefs
as valid sources. Currently, the source is typed as `AnyShaped`, which
also includes vectors—allowing the following (invalid) construct to pass
verification:

```mlir
  %0 = vector.gather %base[%c0][%indices], %mask, %pass_thru
       : vector<16xf32>, vector<16xi32>, vector<16xi1>, vector<16xf32> into vector<16xf32>
```
(Note: the source %base here is a vector, which is incorrect.)

In contrast, `vector.scatter` currently only accepts memrefs, so some
asymmetry remains between the two ops. This PR is a step toward aligning
their semantics.



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