[llvm] 4cff8ef - [ProfileData] Use DenseMap::lookup (NFC) (#94818)

via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 7 18:25:52 PDT 2024


Author: Kazu Hirata
Date: 2024-06-07T18:25:49-07:00
New Revision: 4cff8ef86fffab8e117aea580977d759754c9910

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

LOG: [ProfileData] Use DenseMap::lookup (NFC) (#94818)

Added: 
    

Modified: 
    llvm/include/llvm/ProfileData/InstrProf.h

Removed: 
    


################################################################################
diff  --git a/llvm/include/llvm/ProfileData/InstrProf.h b/llvm/include/llvm/ProfileData/InstrProf.h
index 61bf9492acb8e..d6831eeaa794b 100644
--- a/llvm/include/llvm/ProfileData/InstrProf.h
+++ b/llvm/include/llvm/ProfileData/InstrProf.h
@@ -729,9 +729,7 @@ Function* InstrProfSymtab::getFunction(uint64_t FuncMD5Hash) {
 }
 
 GlobalVariable *InstrProfSymtab::getGlobalVariable(uint64_t MD5Hash) {
-  if (auto Iter = MD5VTableMap.find(MD5Hash); Iter != MD5VTableMap.end())
-    return Iter->second;
-  return nullptr;
+  return MD5VTableMap.lookup(MD5Hash);
 }
 
 // To store the sums of profile count values, or the percentage of


        


More information about the llvm-commits mailing list