[Mlir-commits] [mlir] [MLIR] Use cached symbol tables to get the called function during bufferization (PR #141341)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Sat May 24 02:54:07 PDT 2025


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-mlir

Author: Michele Scuttari (mscuttari)

<details>
<summary>Changes</summary>

Avoid recomputing the symbol tables by using the `BufferizationState` class introduced in #<!-- -->141019.
There is also one similar TODO remaining, but that requires more reasoning as tightly bounded to the `getBufferType`, which is called both during analysis and bufferization.

---
Full diff: https://github.com/llvm/llvm-project/pull/141341.diff


1 Files Affected:

- (modified) mlir/lib/Dialect/Bufferization/Transforms/FuncBufferizableOpInterfaceImpl.cpp (+1-4) 


``````````diff
diff --git a/mlir/lib/Dialect/Bufferization/Transforms/FuncBufferizableOpInterfaceImpl.cpp b/mlir/lib/Dialect/Bufferization/Transforms/FuncBufferizableOpInterfaceImpl.cpp
index 080796208bfc1..6210f1d787bf4 100644
--- a/mlir/lib/Dialect/Bufferization/Transforms/FuncBufferizableOpInterfaceImpl.cpp
+++ b/mlir/lib/Dialect/Bufferization/Transforms/FuncBufferizableOpInterfaceImpl.cpp
@@ -265,10 +265,7 @@ struct CallOpInterface
     //    bufferized callee.
     SmallVector<Value> newOperands;
 
-    // TODO Avoid recomputing the symbol tables every time.
-    SymbolTableCollection symbolTable;
-
-    FuncOp funcOp = getCalledFunction(callOp, symbolTable);
+    FuncOp funcOp = getCalledFunction(callOp, state.getSymbolTables());
     assert(funcOp && "expected CallOp to a FuncOp");
     FunctionType funcType = funcOp.getFunctionType();
 

``````````

</details>


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


More information about the Mlir-commits mailing list