[llvm] [MemProf] Handle missing tail call frames (PR #75823)

Teresa Johnson via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 4 11:50:20 PST 2024


================
@@ -365,8 +379,7 @@ class CallsiteContextGraph {
 
   /// Save lists of calls with MemProf metadata in each function, for faster
   /// iteration.
-  std::vector<std::pair<FuncTy *, std::vector<CallInfo>>>
-      FuncToCallsWithMetadata;
+  std::map<FuncTy *, std::vector<CallInfo>> FuncToCallsWithMetadata;
----------------
teresajohnson wrote:

Good catch. I do have a concern after looking through the uses of this map that one of the iterations could result in non-deterministic behavior. Since I am not sure the best way to index using a key with a deterministic order, I have changed this to MapVector.

Edit: yep, this exposed an ordering non-determinism, in the order the cloned functions were generated and thus emitted into the IR, resulting in a test fix.

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


More information about the llvm-commits mailing list