@@ -289,35 +289,6 @@ static func::FuncOp getCalledFunction(func::CallOp callOp) {
289
289
SymbolTable::lookupNearestSymbolFrom (callOp, sym));
290
290
}
291
291
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
-
321
292
// / Return "true" if the given function signature has tensor semantics.
322
293
static bool hasTensorSignature (func::FuncOp funcOp) {
323
294
return llvm::any_of (funcOp.getFunctionType ().getInputs (),
@@ -493,9 +464,6 @@ mlir::bufferization::analyzeModuleOp(ModuleOp moduleOp,
493
464
// Now analyzing function.
494
465
funcState.startFunctionAnalysis (funcOp);
495
466
496
- // Gather equivalence info for CallOps.
497
- equivalenceAnalysis (funcOp, state, funcState);
498
-
499
467
// Analyze funcOp.
500
468
if (failed (analyzeOp (funcOp, state, statistics)))
501
469
return failure ();
@@ -514,9 +482,6 @@ mlir::bufferization::analyzeModuleOp(ModuleOp moduleOp,
514
482
if (!state.getOptions ().isOpAllowed (funcOp))
515
483
continue ;
516
484
517
- // Gather equivalence info for CallOps.
518
- equivalenceAnalysis (funcOp, state, funcState);
519
-
520
485
// Analyze funcOp.
521
486
if (failed (analyzeOp (funcOp, state, statistics)))
522
487
return failure ();
0 commit comments