[Mlir-commits] [mlir] [MLIR] Make `OneShotModuleBufferize` use `OpInterface` (PR #107295)

Matthias Springer llvmlistbot at llvm.org
Thu Sep 5 00:56:07 PDT 2024


================
@@ -388,27 +401,33 @@ mlir::bufferization::analyzeModuleOp(ModuleOp moduleOp,
     return failure();
 
   // Analyze ops.
-  for (func::FuncOp funcOp : orderedFuncOps) {
-    if (!state.getOptions().isOpAllowed(funcOp))
+  for (FunctionOpInterface funcOp : orderedFuncOps) {
+
+    // The following analysis is specific to the FuncOp type.
+    if(!isa<FuncOp>(funcOp))
+        continue;
----------------
matthias-springer wrote:

I think this is functionally correct but could be a performance problem in practice. This piece of code is gathering information about the relationship between func args and func results. This is needed to compute aliasing values during `CallOpInterface::getAliasingValues`. For functions that were not analyzed, we assume that all CallOp operands potentially alias will all CallOp results. You may get additional buffer copies because of that. Could that become a problem?


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


More information about the Mlir-commits mailing list