[mlir][vector] Add a custom builder for LowerVectorsOp
authorQuentin Colombet <quentin.colombet@gmail.com>
Tue, 17 Jan 2023 11:54:40 +0000 (11:54 +0000)
committerQuentin Colombet <quentin.colombet@gmail.com>
Thu, 19 Jan 2023 11:01:27 +0000 (11:01 +0000)
commite91a5ce278381771ea6d4e6d602e1e486de655f9
treefaa974acaccc2b28b1bf6dcc259d38e7ef4d8c59
parent9b9cfe77a50abccc4b82a497e17566a454b699bd
[mlir][vector] Add a custom builder for LowerVectorsOp

The `lower_vectors` operation of the transform dialect takes a lot of
arguments to build.
In order to make C++ code easier to work with when using this
instruction, introduce a new structure, named `LowerVectorsOptions`, that
aggregates all the options that are used to build this instruction.

This allows to use patterns like:
```
LowerVectorsOptions opts;
opts.setOptZ(...)
  .setOptY(...)...;
builder.create<LowerVectorsOp>(target, opts);
```

Instead of having to pass all N options directly to the builder and set
them in the right order.

NFC

Differential Revision: https://reviews.llvm.org/D141923
mlir/include/mlir/Dialect/Vector/TransformOps/VectorTransformOps.h
mlir/include/mlir/Dialect/Vector/TransformOps/VectorTransformOps.td