[llvm-branch-commits] [mlir] [mlir][Transforms] Dialect Conversion: Add `replaceOpWithMultiple` (PR #115816)

Markus Böck via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Tue Nov 12 02:46:11 PST 2024


================
@@ -618,21 +618,27 @@ class SparseCallConverter : public OpConversionPattern<func::CallOp> {
       assert(!sparseFlat.empty());
       if (sparseFlat.size() > 1) {
         auto flatSize = sparseFlat.size();
-        ValueRange fields(iterator_range<ResultRange::iterator>(
-            newCall.result_begin() + retOffset,
-            newCall.result_begin() + retOffset + flatSize));
-        castedRet.push_back(genTuple(rewriter, loc, retType, fields));
+        packedResultVals.push_back(SmallVector<Value>());
+        llvm::append_range(packedResultVals.back(),
+                           iterator_range<ResultRange::iterator>(
+                               newCall.result_begin() + retOffset,
+                               newCall.result_begin() + retOffset + flatSize));
----------------
zero9178 wrote:

```suggestion
                           newCall.getResults().slice(retOffset, flatSize));
```

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


More information about the llvm-branch-commits mailing list