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) {
55
55
return returnOp;
56
56
}
57
57
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
-
68
58
LogicalResult
69
59
mlir::bufferization::dropEquivalentBufferResults (ModuleOp module ) {
70
60
IRRewriter rewriter (module .getContext ());
71
61
72
62
DenseMap<func::FuncOp, DenseSet<func::CallOp>> callerMap;
73
63
// Collect the mapping of functions to their call sites.
74
64
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 ())) {
76
67
callerMap[calledFunc].insert (callOp);
77
68
}
78
69
});
You can’t perform that action at this time.
0 commit comments