[PATCH] D152840: A new code layout algorithm for function reordering [3a/3]

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 12 21:09:34 PDT 2023


MaskRay added a comment.

Thank you for contributing a new algorithm and sorry for not commenting earlier.

> A new code layout algorithm for function reordering [3a/3]

lld/ELF patches are usually tagged `[ELF] `. You should be able to find many examples with `git log -- lld/ELF`. ` [3a/3]` seems unclear.
I think it's much better to mention https://reviews.llvm.org/D152834 in the summary as `[3a/3]` isn't clear whether 1/3 and 2/3 are :)

I'd like to know a plan whether we are going to remove the existing hfsort heuristic, and state this in the summary.
In D152834 <https://reviews.llvm.org/D152834> you mentioned it, but many folks reading lld including me do not follow bolt.

`--use-cdsort` is the default and overrides the existing hfsort. This should be stated as well.

I will need some time to read D152834 <https://reviews.llvm.org/D152834>.



================
Comment at: lld/ELF/CallGraphSort.cpp:267
+// Fill in necessary data for Cache-Directed Sort.
+void buildCallGraph(std::vector<uint64_t> &FuncSizes,
+                    std::vector<uint64_t> &FuncCounts,
----------------
lld/ code uses `variableName`. Please fix.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D152840



More information about the llvm-commits mailing list