[Mlir-commits] [mlir] [mlir][Linalg] implement bufferization for `linalg.pack` (PR #177982)
Matthias Springer
llvmlistbot at llvm.org
Tue Jan 27 03:05:45 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);
+ }
+
+ LogicalResult bufferize(Operation *op, RewriterBase &rewriter,
+ const BufferizationOptions &options,
+ BufferizationState &state) const {
+ auto packOp = cast<linalg::PackOp>(op);
+ if (packOp.hasPureBufferSemantics())
+ return success();
+ if (!packOp.hasPureTensorSemantics())
+ return packOp.emitError() << "op does not have pure tensor semantics";
----------------
matthias-springer wrote:
This could be supported in the future, so maybe rephrase as `mixed tensor/buffer semantic op not supported yet`
https://github.com/llvm/llvm-project/pull/177982
More information about the Mlir-commits
mailing list