Skip to content

Conversation

@kazutakahirata
Copy link
Contributor

No description provided.

@kazutakahirata kazutakahirata requested a review from nikic February 9, 2025 05:26
@llvmbot llvmbot added the llvm:analysis Includes value tracking, cost tables and constant folding label Feb 9, 2025
@llvmbot
Copy link
Member

llvmbot commented Feb 9, 2025

@llvm/pr-subscribers-llvm-analysis

Author: Kazu Hirata (kazutakahirata)

Changes

Full diff: https://github.com/llvm/llvm-project/pull/126402.diff

1 Files Affected:

  • (modified) llvm/lib/Analysis/DependenceGraphBuilder.cpp (+2-2)
diff --git a/llvm/lib/Analysis/DependenceGraphBuilder.cpp b/llvm/lib/Analysis/DependenceGraphBuilder.cpp
index 7ee2adf49ebb410..82e9dcfbab23f3f 100644
--- a/llvm/lib/Analysis/DependenceGraphBuilder.cpp
+++ b/llvm/lib/Analysis/DependenceGraphBuilder.cpp
@@ -241,8 +241,8 @@ template <class G> void AbstractDependenceGraphBuilder<G>::createDefUseEdges() {
         if (!UI)
           continue;
         NodeType *DstNode = nullptr;
-        if (IMap.find(UI) != IMap.end())
-          DstNode = IMap.find(UI)->second;
+        if (auto It = IMap.find(UI); It != IMap.end())
+          DstNode = It->second;
 
         // In the case of loops, the scope of the subgraph is all the
         // basic blocks (and instructions within them) belonging to the loop. We

@kazutakahirata
Copy link
Contributor Author

@nikic Friendly ping. Thanks!

@kazutakahirata kazutakahirata merged commit 3ce96b9 into llvm:main Feb 9, 2025
8 checks passed
@kazutakahirata kazutakahirata deleted the cleanup_001_repeated_hash_lookups_llvm_Analysis branch February 9, 2025 21:32
Icohedron pushed a commit to Icohedron/llvm-project that referenced this pull request Feb 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

llvm:analysis Includes value tracking, cost tables and constant folding

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants