This tool is solely meant to decypher the output of
clang -forder-file-instrumentation -mllvm -orderfile-write-mapping=mapping
Which is meant to be used to generate order file but used an
undocumented (yet simple!) format.
Differential D152722
[llvm] Intoduce llvm-orderfile serge-sans-paille on Jun 12 2023, 9:13 AM. Authored by
Details
Diff Detail
Event TimelineComment Actions 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, 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 :) Comment Actions 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? Comment Actions I'm not exactly sure what you mean. Right now we need to manually pass the order file to the linker via -symbol-ordering-file, but eventually I'd like this to happen automatically when you pass the profile to the compiler via -fprofile-use=default.profdata. |