[Mlir-commits] [mlir] [mlir][Transforms] Improve `replaceOpWithMultiple` API (PR #132608)

Markus Böck llvmlistbot at llvm.org
Wed Mar 26 05:20:48 PDT 2025


zero9178 wrote:

> > This sadly disqualifies using ArrayRef as parameter as it always returns a const reference, which will never call the move constructor.
> 
> What about `MutableArrayRef` ?

That would work. I just personally think behaviour is a bit unituative as the mutation is rather unexpected. i.e:
```cpp
SmallVector replacement = {...};
replaceOpWithMutable(op, replacements);
// contents of replacement are suddenly all empty vectors
```
compare to having `std::move` show that this is a destructive operation. 

https://github.com/llvm/llvm-project/pull/132608


More information about the Mlir-commits mailing list