[all-commits] [llvm/llvm-project] c7be2d: [mlir][VectorOps] Add fold `ExtractOp(CreateMask) ...

Benjamin Maxwell via All-commits all-commits at lists.llvm.org
Mon Oct 23 04:40:15 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: c7be2dee2a1cf9bcac2c4c34e617f78915880912
      https://github.com/llvm/llvm-project/commit/c7be2dee2a1cf9bcac2c4c34e617f78915880912
  Author: Benjamin Maxwell <benjamin.maxwell at arm.com>
  Date:   2023-10-23 (Mon, 23 Oct 2023)

  Changed paths:
    M mlir/lib/Dialect/Vector/IR/VectorOps.cpp
    M mlir/test/Dialect/Vector/canonicalize.mlir

  Log Message:
  -----------
  [mlir][VectorOps] Add fold `ExtractOp(CreateMask) -> CreateMask` (#69456)

This allows folding extracts from `vector.create_mask` ops that have a
known value. Currently, there's no fold for this, but you get the same
effect from the unrolling in LowerVectorMask (part of
-convert-vector-to-llvm), then folds after that. However, for a future
patch, this simplification needs to be done before lowering to LLVM,
hence the need for this fold.

E.g.:

```
%0 = vector.create_mask %c1, %dimA, %dimB : vector<1x[4]x[4]xi1>
%1 = vector.extract %mask[0] : vector<[4]x[4]xi1>
```
->
```
%0 = vector.create_mask %dimA, %dimB : vector<[4]x[4]xi1>
```




More information about the All-commits mailing list