[llvm] [memprof] Add computeUndriftMap (PR #116478)

Kazu Hirata via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 19 12:45:57 PST 2024


================
@@ -66,6 +67,21 @@ namespace memprof {
 DenseMap<uint64_t, SmallVector<CallEdgeTy, 0>>
 extractCallsFromIR(Module &M, const TargetLibraryInfo &TLI);
 
+struct LineLocationHash {
+  uint64_t operator()(const LineLocation &Loc) const {
+    return Loc.getHashCode();
+  }
+};
+
+using LocToLocMap =
+    std::unordered_map<LineLocation, LineLocation, LineLocationHash>;
----------------
kazutakahirata wrote:

My laziness.  I would need to define `DenseMapInfo<LineLocation>`, setting aside the empty and tombstones keys.  I'd like to leave this to a follow-up patch.

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


More information about the llvm-commits mailing list