[llvm] f8bd98b - [Analysis] Avoid repeated hash lookups (NFC) (#110378)

via llvm-commits llvm-commits at lists.llvm.org
Sat Sep 28 13:11:26 PDT 2024


Author: Kazu Hirata
Date: 2024-09-28T13:11:22-07:00
New Revision: f8bd98b3f1e6e71f489f592effb1c96b863ac08c

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

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

Added: 
    

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

Removed: 
    


################################################################################
diff  --git a/llvm/include/llvm/Analysis/EHUtils.h b/llvm/include/llvm/Analysis/EHUtils.h
index 3ad0878bd64f88..aaf2882d697d14 100644
--- a/llvm/include/llvm/Analysis/EHUtils.h
+++ b/llvm/include/llvm/Analysis/EHUtils.h
@@ -24,10 +24,8 @@ static void computeEHOnlyBlocks(FunctionT &F, DenseSet<BlockT *> &EHBlocks) {
   DenseMap<BlockT *, Status> Statuses;
 
   auto GetStatus = [&](BlockT *BB) {
-    if (Statuses.contains(BB))
-      return Statuses[BB];
-    else
-      return Unknown;
+    auto It = Statuses.find(BB);
+    return It != Statuses.end() ? It->second : Unknown;
   };
 
   auto CheckPredecessors = [&](BlockT *BB, Status Stat) {


        


More information about the llvm-commits mailing list