[llvm] 02cae55 - [Analysis] Avoid repeated hash lookups (NFC) (#109564)

via llvm-commits llvm-commits at lists.llvm.org
Sun Sep 22 00:44:06 PDT 2024


Author: Kazu Hirata
Date: 2024-09-22T00:44:02-07:00
New Revision: 02cae5584933365c7904608a3096e859da9b2031

URL: https://github.com/llvm/llvm-project/commit/02cae5584933365c7904608a3096e859da9b2031
DIFF: https://github.com/llvm/llvm-project/commit/02cae5584933365c7904608a3096e859da9b2031.diff

LOG: [Analysis] Avoid repeated hash lookups (NFC) (#109564)

Added: 
    

Modified: 
    llvm/include/llvm/Analysis/GenericDomTreeUpdaterImpl.h

Removed: 
    


################################################################################
diff  --git a/llvm/include/llvm/Analysis/GenericDomTreeUpdaterImpl.h b/llvm/include/llvm/Analysis/GenericDomTreeUpdaterImpl.h
index 35c54a6062bfd4..b79eaef57710fa 100644
--- a/llvm/include/llvm/Analysis/GenericDomTreeUpdaterImpl.h
+++ b/llvm/include/llvm/Analysis/GenericDomTreeUpdaterImpl.h
@@ -107,8 +107,7 @@ void GenericDomTreeUpdater<DerivedT, DomTreeT, PostDomTreeT>::
     // b. If the edge doesn't exist, we can then infer that {Delete, A, B}
     // actually happened but {Insert, A, B} was an invalid update which never
     // happened. DTU will submit {Delete, A, B} in this case.
-    if (!isSelfDominance(U) && Seen.count(Edge) == 0) {
-      Seen.insert(Edge);
+    if (!isSelfDominance(U) && Seen.insert(Edge).second) {
       // If the update doesn't appear in the CFG, it means that
       // either the change isn't made or relevant operations
       // result in a no-op.


        


More information about the llvm-commits mailing list