[all-commits] [llvm/llvm-project] 6afeb4: [mlir][tblgen] Add additional constructor to Adapt...

Matthias Springer via All-commits all-commits at lists.llvm.org
Sun Oct 13 10:50:44 PDT 2024


  Branch: refs/heads/users/matthias-springer/tblgen_copy
  Home:   https://github.com/llvm/llvm-project
  Commit: 6afeb419578efc0f9fa8855a7fe71df0113ed09c
      https://github.com/llvm/llvm-project/commit/6afeb419578efc0f9fa8855a7fe71df0113ed09c
  Author: Matthias Springer <mspringer at nvidia.com>
  Date:   2024-10-13 (Sun, 13 Oct 2024)

  Changed paths:
    M mlir/test/mlir-tblgen/op-decl-and-defs.td
    M mlir/tools/mlir-tblgen/OpDefinitionsGen.cpp

  Log Message:
  -----------
  [mlir][tblgen] Add additional constructor to Adaptor class

Add an additional adaptor constructor that copies everything except for the values. These are provided with by a second parameter.

This commit is in preparation of merging the 1:1 and 1:N dialect conversions. As part of that, a new `matchAndRewrite` function is added. For details, see this RFC: https://discourse.llvm.org/t/rfc-merging-1-1-and-1-n-dialect-conversions/82513

```c++
template <typename SourceOp>
class OpConversionPattern : public ConversionPattern {
 public:
  virtual LogicalResult
  matchAndRewrite(SourceOp op, OneToNOpAdaptor adaptor,
                  ConversionPatternRewriter &rewriter) const {
    SmallVector<Value> oneToOneOperands =
        getOneToOneAdaptorOperands(adaptor.getOperands());

    // This OpAdaptor constructor is added by this commit.
    return matchAndRewrite(op, OpAdaptor(oneToOneOperands, adaptor), rewriter);
  }
};
```



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