@@ -289,35 +289,6 @@ static func::FuncOp getCalledFunction(func::CallOp callOp) {
289289 SymbolTable::lookupNearestSymbolFrom (callOp, sym));
290290}
291291
292- // / Gather equivalence info of CallOps.
293- // / Note: This only adds new equivalence info if the called function was already
294- // / analyzed.
295- // TODO: This does not handle cyclic function call graphs etc.
296- static void equivalenceAnalysis (func::FuncOp funcOp,
297- OneShotAnalysisState &state,
298- FuncAnalysisState &funcState) {
299- funcOp->walk ([&](func::CallOp callOp) {
300- func::FuncOp calledFunction = getCalledFunction (callOp);
301- assert (calledFunction && " could not retrieved called func::FuncOp" );
302-
303- // No equivalence info available for the called function.
304- if (!funcState.equivalentFuncArgs .count (calledFunction))
305- return WalkResult::skip ();
306-
307- for (auto it : funcState.equivalentFuncArgs [calledFunction]) {
308- int64_t returnIdx = it.first ;
309- int64_t bbargIdx = it.second ;
310- if (!state.isInPlace (callOp->getOpOperand (bbargIdx)))
311- continue ;
312- Value returnVal = callOp.getResult (returnIdx);
313- Value argVal = callOp->getOperand (bbargIdx);
314- state.unionEquivalenceClasses (returnVal, argVal);
315- }
316-
317- return WalkResult::advance ();
318- });
319- }
320-
321292// / Return "true" if the given function signature has tensor semantics.
322293static bool hasTensorSignature (func::FuncOp funcOp) {
323294 return llvm::any_of (funcOp.getFunctionType ().getInputs (),
@@ -493,9 +464,6 @@ mlir::bufferization::analyzeModuleOp(ModuleOp moduleOp,
493464 // Now analyzing function.
494465 funcState.startFunctionAnalysis (funcOp);
495466
496- // Gather equivalence info for CallOps.
497- equivalenceAnalysis (funcOp, state, funcState);
498-
499467 // Analyze funcOp.
500468 if (failed (analyzeOp (funcOp, state, statistics)))
501469 return failure ();
@@ -514,9 +482,6 @@ mlir::bufferization::analyzeModuleOp(ModuleOp moduleOp,
514482 if (!state.getOptions ().isOpAllowed (funcOp))
515483 continue ;
516484
517- // Gather equivalence info for CallOps.
518- equivalenceAnalysis (funcOp, state, funcState);
519-
520485 // Analyze funcOp.
521486 if (failed (analyzeOp (funcOp, state, statistics)))
522487 return failure ();
0 commit comments