[Mlir-commits] [mlir] [mlir][Transforms] Improve `replaceOpWithMultiple` API (PR #132608)
Markus Böck
llvmlistbot at llvm.org
Sun Mar 23 07:00:06 PDT 2025
================
@@ -898,6 +898,11 @@ class ConversionPatternRewriter final : public PatternRewriter {
/// Replace the given operation with the new value ranges. The number of op
/// results and value ranges must match. The given operation is erased.
void replaceOpWithMultiple(Operation *op, ArrayRef<ValueRange> newValues);
+ template <typename RangeT>
+ void replaceOpWithMultiple(Operation *op, RangeT newValues) {
----------------
zero9178 wrote:
```suggestion
void replaceOpWithMultiple(Operation *op, RangeT&& newValues) {
```
this would trigger coying of `SmallVector`s and similar otherwise
https://github.com/llvm/llvm-project/pull/132608
More information about the Mlir-commits
mailing list