[PATCH] D152722: [llvm] Intoduce llvm-orderfile
Ellis Hoag via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Jun 13 21:14:25 PDT 2023
ellis added a comment.
I'm happy to see that there is interest in order files! Recently, I've been developing order file generation within IRPGO that is understood by the `llvm-profdata` tool. In short, you can instrument a binary to get function traces, merge them into a profile, and then use the `llvm-profdata` tool to compute a function order which you can pass to the linker using `-symbol-ordering-file`.
$ clang -fprofile-generate -mllvm -pgo-temporal-instrumentation main.cpp
$ ./a.out
$ llvm-profdata merge default.profraw -o default.profdata
$ llvm-profdata order default.profdata -o order.txt
Please see https://discourse.llvm.org/t/rfc-temporal-profiling-extension-for-irpgo/68068 for details on that.
When combined with Lightweight Instrumentation <https://discourse.llvm.org/t/instrprofiling-lightweight-instrumentation/59113>, this is more lightweight (at runtime), has better infra support, has more features, and should give better performance than `-forder-file-instrumentation`. In fact, I plan to deprecate `-forder-file-instrumentation` now that the initial work on temporal instrumentation is done.
Please don't hesitate to reach out on discord or discourse if you have questions :)
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D152722/new/
https://reviews.llvm.org/D152722
More information about the llvm-commits
mailing list