Skip to content

Conversation

@kazutakahirata
Copy link
Contributor

No description provided.

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

llvmbot commented Feb 13, 2025

@llvm/pr-subscribers-llvm-analysis

Author: Kazu Hirata (kazutakahirata)

Changes

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

1 Files Affected:

  • (modified) llvm/lib/Analysis/PhiValues.cpp (+4-2)
diff --git a/llvm/lib/Analysis/PhiValues.cpp b/llvm/lib/Analysis/PhiValues.cpp
index 656a17e9dc30e..1e0dac35f9ef3 100644
--- a/llvm/lib/Analysis/PhiValues.cpp
+++ b/llvm/lib/Analysis/PhiValues.cpp
@@ -67,8 +67,10 @@ void PhiValues::processPhi(const PHINode *Phi,
       }
       // If the phi did not become part of a component then this phi and that
       // phi are part of the same component, so adjust the depth number.
-      if (!ReachableMap.count(OpDepthNumber))
-        DepthMap[Phi] = std::min(DepthMap[Phi], OpDepthNumber);
+      if (!ReachableMap.count(OpDepthNumber)) {
+        unsigned &Depth = DepthMap[Phi];
+        Depth = std::min(Depth, OpDepthNumber);
+      }
     } else {
       TrackedValues.insert(PhiValuesCallbackVH(PhiOp, this));
     }

@kazutakahirata kazutakahirata merged commit 44b61e0 into llvm:main Feb 13, 2025
10 checks passed
@kazutakahirata kazutakahirata deleted the cleanup_001_repeated_hash_lookups_llvm_Analysis branch February 13, 2025 17:11
joaosaffran pushed a commit to joaosaffran/llvm-project that referenced this pull request Feb 14, 2025
sivan-shani pushed a commit to sivan-shani/llvm-project that referenced this pull request Feb 24, 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