[llvm-branch-commits] [mlir] [mlir][Transforms] Add 1:N `matchAndRewrite` overload (PR #116470)

Markus Böck via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Sun Nov 17 01:19:28 PST 2024


================
@@ -1538,10 +1607,9 @@ void ConversionPatternRewriter::replaceOp(Operation *op, ValueRange newValues) {
     impl->logger.startLine()
         << "** Replace : '" << op->getName() << "'(" << op << ")\n";
   });
-  SmallVector<ReplacementValues> newVals(newValues.size());
-  for (auto [index, val] : llvm::enumerate(newValues))
-    if (val)
-      newVals[index].push_back(val);
+  SmallVector<ValueRange> newVals;
+  for (int i = 0; i < newValues.size(); ++i)
+    newVals.push_back(newValues.slice(i, 1));
----------------
zero9178 wrote:

Ahhh yes, you're right, that was an overly ambitious suggestion. Implicit conversions strike again

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


More information about the llvm-branch-commits mailing list