diff --git a/mlir/include/mlir/Dialect/Bufferization/Transforms/FuncBufferizableOpInterfaceImpl.h b/mlir/include/mlir/Dialect/Bufferization/Transforms/FuncBufferizableOpInterfaceImpl.h --- a/mlir/include/mlir/Dialect/Bufferization/Transforms/FuncBufferizableOpInterfaceImpl.h +++ b/mlir/include/mlir/Dialect/Bufferization/Transforms/FuncBufferizableOpInterfaceImpl.h @@ -52,9 +52,6 @@ /// indices. DenseMap equivalentFuncArgs; - /// A mapping of ReturnOp OpOperand indices to aliasing FuncOp BBArg indices. - DenseMap aliasingFuncArgs; - /// A mapping of FuncOp BBArg indices to aliasing ReturnOp OpOperand indices. DenseMap aliasingReturnVals; diff --git a/mlir/lib/Dialect/Bufferization/Transforms/FuncBufferizableOpInterfaceImpl.cpp b/mlir/lib/Dialect/Bufferization/Transforms/FuncBufferizableOpInterfaceImpl.cpp --- a/mlir/lib/Dialect/Bufferization/Transforms/FuncBufferizableOpInterfaceImpl.cpp +++ b/mlir/lib/Dialect/Bufferization/Transforms/FuncBufferizableOpInterfaceImpl.cpp @@ -23,20 +23,16 @@ void FuncAnalysisState::startFunctionAnalysis(FuncOp funcOp) { analyzedFuncOps[funcOp] = FuncOpAnalysisState::InProgress; auto createdEquiv = equivalentFuncArgs.try_emplace(funcOp, IndexMapping()); - auto createdAliasingOperands = - aliasingFuncArgs.try_emplace(funcOp, IndexToIndexListMapping()); auto createdAliasingResults = aliasingReturnVals.try_emplace(funcOp, IndexToIndexListMapping()); auto createdRead = readBbArgs.try_emplace(funcOp, BbArgIndexSet()); auto createdWritten = writtenBbArgs.try_emplace(funcOp, BbArgIndexSet()); (void)createdEquiv; - (void)createdAliasingOperands; (void)createdAliasingResults; (void)createdRead; (void)createdWritten; #ifndef NDEBUG assert(createdEquiv.second && "equivalence info exists already"); - assert(createdAliasingOperands.second && "aliasing info exists already"); assert(createdAliasingResults.second && "aliasing info exists already"); assert(createdRead.second && "bbarg access info exists already"); assert(createdWritten.second && "bbarg access info exists already"); @@ -196,26 +192,6 @@ return result; } - SmallVector - getAliasingOpOperand(Operation *op, OpResult opResult, - const AnalysisState &state) const { - func::CallOp callOp = cast(op); - FuncOp funcOp = getCalledFunction(callOp); - assert(funcOp && "expected CallOp to a FuncOp"); - if (getFuncOpAnalysisState(state, funcOp) != FuncOpAnalysisState::Analyzed) - // FuncOp not analyzed yet. Any OpOperand may be aliasing. - return detail::unknownGetAliasingOpOperand(opResult); - - // Get aliasing bbArgs from state. - const FuncAnalysisState &funcState = getFuncAnalysisState(state); - auto aliasingFuncArgs = funcState.aliasingFuncArgs.lookup(funcOp).lookup( - opResult.getResultNumber()); - SmallVector result; - for (int64_t bbArgIdx : aliasingFuncArgs) - result.push_back(&callOp->getOpOperand(bbArgIdx)); - return result; - } - BufferRelation bufferRelation(Operation *op, OpResult opResult, const AnalysisState &state) const { func::CallOp callOp = cast(op); diff --git a/mlir/lib/Dialect/Bufferization/Transforms/OneShotModuleBufferize.cpp b/mlir/lib/Dialect/Bufferization/Transforms/OneShotModuleBufferize.cpp --- a/mlir/lib/Dialect/Bufferization/Transforms/OneShotModuleBufferize.cpp +++ b/mlir/lib/Dialect/Bufferization/Transforms/OneShotModuleBufferize.cpp @@ -139,7 +139,6 @@ continue; int64_t returnIdx = resultIt.index(); int64_t bbArgIdx = inputIt.index(); - funcState.aliasingFuncArgs[funcOp][returnIdx].push_back(bbArgIdx); funcState.aliasingReturnVals[funcOp][bbArgIdx].push_back(returnIdx); } } @@ -161,10 +160,8 @@ if (state.getOptions().testAnalysisOnly) annotateEquivalentReturnBbArg(returnVal, bbArg); } - if (state.areAliasingBufferizedValues(returnVal.get(), bbArg)) { - funcState.aliasingFuncArgs[funcOp][returnIdx].push_back(bbArgIdx); + if (state.areAliasingBufferizedValues(returnVal.get(), bbArg)) funcState.aliasingReturnVals[funcOp][bbArgIdx].push_back(returnIdx); - } } return success();