[Mlir-commits] [mlir] 0078d4b - [Pass] Avoid repeated hash lookups (NFC) (#107761)
llvmlistbot at llvm.org
llvmlistbot at llvm.org
Sun Sep 8 09:14:12 PDT 2024
Author: Kazu Hirata
Date: 2024-09-08T09:14:08-07:00
New Revision: 0078d4b5a467d2dd30b066740979d73483d56328
URL: https://github.com/llvm/llvm-project/commit/0078d4b5a467d2dd30b066740979d73483d56328
DIFF: https://github.com/llvm/llvm-project/commit/0078d4b5a467d2dd30b066740979d73483d56328.diff
LOG: [Pass] Avoid repeated hash lookups (NFC) (#107761)
Added:
Modified:
mlir/lib/Pass/Pass.cpp
Removed:
################################################################################
diff --git a/mlir/lib/Pass/Pass.cpp b/mlir/lib/Pass/Pass.cpp
index 57a6c20141d2c1..deca03ae137f4e 100644
--- a/mlir/lib/Pass/Pass.cpp
+++ b/mlir/lib/Pass/Pass.cpp
@@ -938,11 +938,9 @@ AnalysisManager AnalysisManager::nestImmediate(Operation *op) {
assert(impl->getOperation() == op->getParentOp() &&
"expected immediate child operation");
- auto it = impl->childAnalyses.find(op);
- if (it == impl->childAnalyses.end())
- it = impl->childAnalyses
- .try_emplace(op, std::make_unique<NestedAnalysisMap>(op, impl))
- .first;
+ auto [it, inserted] = impl->childAnalyses.try_emplace(op);
+ if (inserted)
+ it->second = std::make_unique<NestedAnalysisMap>(op, impl);
return {it->second.get()};
}
More information about the Mlir-commits
mailing list