File tree Expand file tree Collapse file tree 1 file changed +2
-11
lines changed
mlir/lib/Dialect/Bufferization/Transforms Expand file tree Collapse file tree 1 file changed +2
-11
lines changed Original file line number Diff line number Diff line change @@ -55,24 +55,15 @@ static func::ReturnOp getAssumedUniqueReturnOp(func::FuncOp funcOp) {
5555 return returnOp;
5656}
5757
58- // / Return the func::FuncOp called by `callOp`.
59- static func::FuncOp getCalledFunction (CallOpInterface callOp) {
60- SymbolRefAttr sym =
61- llvm::dyn_cast_if_present<SymbolRefAttr>(callOp.getCallableForCallee ());
62- if (!sym)
63- return nullptr ;
64- return dyn_cast_or_null<func::FuncOp>(
65- SymbolTable::lookupNearestSymbolFrom (callOp, sym));
66- }
67-
6858LogicalResult
6959mlir::bufferization::dropEquivalentBufferResults (ModuleOp module ) {
7060 IRRewriter rewriter (module .getContext ());
7161
7262 DenseMap<func::FuncOp, DenseSet<func::CallOp>> callerMap;
7363 // Collect the mapping of functions to their call sites.
7464 module .walk ([&](func::CallOp callOp) {
75- if (func::FuncOp calledFunc = getCalledFunction (callOp)) {
65+ if (func::FuncOp calledFunc =
66+ dyn_cast_or_null<func::FuncOp>(callOp.resolveCallable ())) {
7667 callerMap[calledFunc].insert (callOp);
7768 }
7869 });
You can’t perform that action at this time.
0 commit comments