[Mlir-commits] [mlir] 86fd1c1 - [bufferization] Simplify code. NFCI.
Benjamin Kramer
llvmlistbot at llvm.org
Sat May 21 01:59:43 PDT 2022
Author: Benjamin Kramer
Date: 2022-05-21T10:58:57+02:00
New Revision: 86fd1c139fb81f17a1d58ba5200df414b5eaebb1
URL: https://github.com/llvm/llvm-project/commit/86fd1c139fb81f17a1d58ba5200df414b5eaebb1
DIFF: https://github.com/llvm/llvm-project/commit/86fd1c139fb81f17a1d58ba5200df414b5eaebb1.diff
LOG: [bufferization] Simplify code. NFCI.
Added:
Modified:
mlir/lib/Dialect/Bufferization/Transforms/OneShotModuleBufferize.cpp
Removed:
################################################################################
diff --git a/mlir/lib/Dialect/Bufferization/Transforms/OneShotModuleBufferize.cpp b/mlir/lib/Dialect/Bufferization/Transforms/OneShotModuleBufferize.cpp
index 377bc58b2d53f..aa6672860ec28 100644
--- a/mlir/lib/Dialect/Bufferization/Transforms/OneShotModuleBufferize.cpp
+++ b/mlir/lib/Dialect/Bufferization/Transforms/OneShotModuleBufferize.cpp
@@ -342,10 +342,8 @@ getFuncOpsOrderedByCalls(ModuleOp moduleOp,
return callOp->emitError() << "expected a CallOp";
func::FuncOp calledFunction = getCalledFunction(callOp);
assert(calledFunction && "could not retrieved called func::FuncOp");
- auto it = callerMap.try_emplace(calledFunction, DenseSet<Operation *>{});
- it.first->getSecond().insert(callOp);
- if (calledBy[calledFunction].count(funcOp) == 0) {
- calledBy[calledFunction].insert(funcOp);
+ callerMap[calledFunction].insert(callOp);
+ if (calledBy[calledFunction].insert(funcOp).second) {
numberCallOpsContainedInFuncOp[funcOp]++;
}
return WalkResult::advance();
More information about the Mlir-commits
mailing list