[llvm] [memprof] Simplify readMemprof (NFC) (PR #119930)

Snehasish Kumar via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 13 18:02:40 PST 2024


================
@@ -969,9 +967,15 @@ readMemprof(Module &M, Function &F, IndexedInstrProfReader *MemProfReader,
   // Build maps of the location hash to all profile data with that leaf location
   // (allocation info and the callsites).
   std::map<uint64_t, std::set<const AllocationInfo *>> LocHashToAllocInfo;
-  // For the callsites we need to record the index of the associated frame in
-  // the frame array (see comments below where the map entries are added).
-  std::map<uint64_t, std::set<std::pair<const std::vector<Frame> *, unsigned>>>
+  // A hash function for std::unordered_set<ArrayRef<Frame>> to work.
+  struct CallStackHash {
----------------
snehasish wrote:

Can we skip this in favour of 
` std::map<uint64_t, std::unordered_set<ArrayRef<Frame>, decltype(&computeFullStackId)>>` ?



https://github.com/llvm/llvm-project/pull/119930


More information about the llvm-commits mailing list