[PATCH] D95988: [CSSPGO] Process functions in a top-down order on a dynamic call graph.

Hongtao Yu via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 11 11:53:40 PST 2021


hoy added inline comments.


================
Comment at: llvm/lib/Transforms/IPO/SampleProfile.cpp:2491
+    if (!ProfileOrderMap.empty()) {
+      llvm::sort(FunctionOrderList.begin() + Start, FunctionOrderList.end(),
+                 [&ProfileOrderMap](Function *Left, Function *Right) {
----------------
wmi wrote:
> Many nodes in the static graph may not exist in ProfileOrderMap so they all get the same 0 value from the map. Better use llvm::stable_sort.
Good catch! Stable sort should make the change of existing static order minimized.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D95988



More information about the llvm-commits mailing list