[Mlir-commits] [mlir] [mlir][Linalg] implement bufferization for `linalg.pack` (PR #177982)

Ryutaro Okada llvmlistbot at llvm.org
Mon Jan 26 08:28:52 PST 2026


================
@@ -191,6 +191,47 @@ struct SoftmaxOpInterface
     return success();
   }
 };
+
+struct PackOpInterface
+    : public DstBufferizableOpInterfaceExternalModel<PackOpInterface,
+                                                     linalg::PackOp> {
+  bool bufferizesToMemoryRead(Operation *op, OpOperand &opOperand,
+                              const AnalysisState &state) const {
+    auto packOp = cast<linalg::PackOp>(op);
+    return !packOp.isDpsInit(&opOperand);
----------------
sakupan102 wrote:

Since dest is never read, the other operands may be read, so I made the function return true only for non‑dest operands. Is that different from the intended design?

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


More information about the Mlir-commits mailing list