[PATCH] D152722: [llvm] Intoduce llvm-orderfile
serge via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Jun 15 01:31:42 PDT 2023
serge-sans-paille added a comment.
In D152722#4419875 <https://reviews.llvm.org/D152722#4419875>, @ellis wrote:
> 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 :)
Great news! Easier integration is a big plus for me, I definitively don't mind moving to this approach if we plan to obsolete `-forder-file-instrumentation`. One question though: from a user perspective, it would be great to have the ordering be transparent for the user so that any PGO build (with temporal instrumentation) would benefit from it. Does that make sense to you?
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