[llvm] 3ce96b9 - [Analysis] Avoid repeated hash lookups (NFC) (#126402)
via llvm-commits
llvm-commits at lists.llvm.org
Sun Feb 9 13:32:41 PST 2025
Author: Kazu Hirata
Date: 2025-02-09T13:32:37-08:00
New Revision: 3ce96b9ee961e0dc1f27fbb96339c6253f0196bc
URL: https://github.com/llvm/llvm-project/commit/3ce96b9ee961e0dc1f27fbb96339c6253f0196bc
DIFF: https://github.com/llvm/llvm-project/commit/3ce96b9ee961e0dc1f27fbb96339c6253f0196bc.diff
LOG: [Analysis] Avoid repeated hash lookups (NFC) (#126402)
Added:
Modified:
llvm/lib/Analysis/DependenceGraphBuilder.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Analysis/DependenceGraphBuilder.cpp b/llvm/lib/Analysis/DependenceGraphBuilder.cpp
index 7ee2adf49ebb410..c076e52ce6e1451 100644
--- a/llvm/lib/Analysis/DependenceGraphBuilder.cpp
+++ b/llvm/lib/Analysis/DependenceGraphBuilder.cpp
@@ -240,9 +240,7 @@ template <class G> void AbstractDependenceGraphBuilder<G>::createDefUseEdges() {
Instruction *UI = dyn_cast<Instruction>(U);
if (!UI)
continue;
- NodeType *DstNode = nullptr;
- if (IMap.find(UI) != IMap.end())
- DstNode = IMap.find(UI)->second;
+ NodeType *DstNode = IMap.lookup(UI);
// In the case of loops, the scope of the subgraph is all the
// basic blocks (and instructions within them) belonging to the loop. We
More information about the llvm-commits
mailing list