[all-commits] [llvm/llvm-project] 8823e9: [mlir][ODS] Change `get...Mutable` to return `OpOp...

Matthias Springer via All-commits all-commits at lists.llvm.org
Tue Oct 3 23:35:53 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 8823e961f6a41854668d2dc1a1fc787cfa85ca43
      https://github.com/llvm/llvm-project/commit/8823e961f6a41854668d2dc1a1fc787cfa85ca43
  Author: Matthias Springer <me at m-sp.org>
  Date:   2023-10-04 (Wed, 04 Oct 2023)

  Changed paths:
    M mlir/include/mlir/IR/Value.h
    M mlir/include/mlir/IR/ValueRange.h
    M mlir/lib/Dialect/Bufferization/IR/BufferizationOps.cpp
    M mlir/lib/Dialect/Linalg/Transforms/ElementwiseOpFusion.cpp
    M mlir/lib/Dialect/SCF/Transforms/TileUsingInterface.cpp
    M mlir/lib/Dialect/Tensor/Transforms/BufferizableOpInterfaceImpl.cpp
    M mlir/lib/Dialect/Tensor/Transforms/SubsetInsertionOpInterfaceImpl.cpp
    M mlir/lib/IR/OperationSupport.cpp
    M mlir/test/lib/Dialect/Test/TestDialect.cpp
    M mlir/test/mlir-tblgen/op-decl-and-defs.td
    M mlir/tools/mlir-tblgen/OpDefinitionsGen.cpp

  Log Message:
  -----------
  [mlir][ODS] Change `get...Mutable` to return `OpOperand &` for single operands (#66519)

The TableGen code generator now generates C++ code that returns a single
`OpOperand &` for `get...Mutable` of operands that are not variadic and
not optional. `OpOperand::set`/`assign` can be used to set a value (same
as `MutableOperandRange::assign`). This is safer than
`MutableOperandRange` because only single values (and no longer
`ValueRange`) can be assigned.

E.g.:
```
// Assignment of multiple values to non-variadic operand.
// Before: Compiles, but produces invalid op.
// After: Compilation error.
extractSliceOp.getSourceMutable().assign({v1, v2});
```




More information about the All-commits mailing list