[Mlir-commits] [mlir] [mlir][linalg] Use ub.poison in data layout propagation if a packed operand requires padding. (PR #159467)

Han-Chung Wang llvmlistbot at llvm.org
Fri Sep 19 14:17:53 PDT 2025


================
@@ -1110,9 +1139,14 @@ pushDownUnPackOpThroughGenericOp(RewriterBase &rewriter, GenericOp genericOp,
     return failure();
 
   // Rebuild the indexing map for the corresponding init operand.
-  auto [packedOutOperand, packedOutIndexingMap] =
-      getOrCreatePackedViewOfOperand(rewriter, genericOp.getLoc(), *packInfo,
-                                     genericOp, genericOp.getDpsInitOperand(0));
+  auto mayBepackedOperandAndIndexing = getOrCreatePackedViewOfOperand(
+      rewriter, genericOp.getLoc(), *packInfo, genericOp,
+      genericOp.getDpsInitOperand(0), poisonPaddingOk);
+  if (failed(mayBepackedOperandAndIndexing)) {
+    return failure();
+  }
+  auto packedOutOperand = std::get<0>(*mayBepackedOperandAndIndexing);
+  auto packedOutIndexingMap = std::get<1>(*mayBepackedOperandAndIndexing);
----------------
hanhanW wrote:

Can we use structured binding declaration in this case? E.g.,

```cpp
auto [packedOutOperand, packedOutIndexingMap] = mayBepackedOperandAndIndexing.value();
```

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


More information about the Mlir-commits mailing list