[all-commits] [llvm/llvm-project] caf89c: [mlir][Vector] Support 0-D vectors in `ConstantMas...

Michal Terepeta via All-commits all-commits at lists.llvm.org
Mon Dec 6 00:05:39 PST 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: caf89c0db679f79ca6c9a75c5acc6151dd380f26
      https://github.com/llvm/llvm-project/commit/caf89c0db679f79ca6c9a75c5acc6151dd380f26
  Author: Michal Terepeta <michalt at google.com>
  Date:   2021-12-06 (Mon, 06 Dec 2021)

  Changed paths:
    M mlir/include/mlir/Dialect/Vector/VectorOps.td
    M mlir/lib/Dialect/Vector/VectorOps.cpp
    M mlir/lib/Dialect/Vector/VectorTransforms.cpp
    M mlir/test/Conversion/VectorToLLVM/vector-to-llvm.mlir
    M mlir/test/Dialect/Vector/invalid.mlir
    M mlir/test/Dialect/Vector/ops.mlir
    M mlir/test/Integration/Dialect/Vector/CPU/test-0-d-vectors.mlir

  Log Message:
  -----------
  [mlir][Vector] Support 0-D vectors in `ConstantMaskOp`

To support creating both a mask with just a single `true` and `false` values,
I had to relax the restriction in the verifier that the rank is always equal to
the length of the attribute array, in other words, we now allow:

- `vector.constant_mask [0] : vector<i1>` which gets lowered to
  `arith.constant dense<false> : vector<i1>`
- `vector.constant_mask [1] : vector<i1>` which gets lowered to
  `arith.constant dense<true> : vector<i1>`

(the attribute list for the 0-D case must be a singleton containing
either `0` or `1`)

Reviewed By: nicolasvasilache

Differential Revision: https://reviews.llvm.org/D115023




More information about the All-commits mailing list