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

Wei Mi via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 11 11:39:36 PST 2021


wmi 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) {
----------------
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.


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