[llvm] f71e25b - [memprof] Simplify IndexedMemProfRecord::operator== (NFC) (#88986)

via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 16 20:35:38 PDT 2024


Author: Kazu Hirata
Date: 2024-04-16T20:35:34-07:00
New Revision: f71e25bb669d662f98823d6d81b3f918538c9239

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

LOG: [memprof] Simplify IndexedMemProfRecord::operator== (NFC) (#88986)

llvm::SmallVector::operator== exactly meets our needs.

Added: 
    

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

Removed: 
    


################################################################################
diff  --git a/llvm/include/llvm/ProfileData/MemProf.h b/llvm/include/llvm/ProfileData/MemProf.h
index d43fb1c93bb8ef..7f3956bd739390 100644
--- a/llvm/include/llvm/ProfileData/MemProf.h
+++ b/llvm/include/llvm/ProfileData/MemProf.h
@@ -370,14 +370,9 @@ struct IndexedMemProfRecord {
   size_t serializedSize(IndexedVersion Version) const;
 
   bool operator==(const IndexedMemProfRecord &Other) const {
-    if (Other.AllocSites.size() != AllocSites.size())
+    if (Other.AllocSites != AllocSites)
       return false;
 
-    for (size_t I = 0; I < AllocSites.size(); I++) {
-      if (AllocSites[I] != Other.AllocSites[I])
-        return false;
-    }
-
     if (Other.CallSiteIds != CallSiteIds)
       return false;
     return true;


        


More information about the llvm-commits mailing list