[Mlir-commits] [mlir] [MLIR] Use cached symbol tables to get the called function during bufferization (PR #141341)
Michele Scuttari
llvmlistbot at llvm.org
Sat May 24 02:53:33 PDT 2025
https://github.com/mscuttari created https://github.com/llvm/llvm-project/pull/141341
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.
>From de5a7d7c773c6bbfd20b486da9f86d30108a198b Mon Sep 17 00:00:00 2001
From: Michele Scuttari <michele.scuttari at outlook.com>
Date: Sat, 24 May 2025 11:26:52 +0200
Subject: [PATCH] Use cached symbol tables to get the called function
---
.../Transforms/FuncBufferizableOpInterfaceImpl.cpp | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
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();
More information about the Mlir-commits
mailing list