[PATCH] D107173: [CSSPGO] Introduce MD5-based context-sensitive profile

Hongtao Yu via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 30 09:59:32 PDT 2021


hoy added inline comments.


================
Comment at: llvm/lib/Transforms/IPO/SampleContextTracker.cpp:222
+    if (!Context.isBaseContext()) {
+      auto Hash = MD5Hash(Context.getContextInMd5());
+      FuncToCtxtProfiles[Context.getGUID()].emplace(Hash, FSamples);
----------------
The ordering based `Hash` in `FuncToCtxtProfiles` is mainly to achieve a consistent context promotion between md5 and non-md5 profiles which in turn gives a consistent codegen. However it is expansive. I tried sorting by the the combination of total sample counts and head sample counts, but still could not get every case covered. I think we might want to do this for non-md5 profile only, to favor md5 performance.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D107173/new/

https://reviews.llvm.org/D107173



More information about the llvm-commits mailing list