about summary refs log tree commit diff
path: root/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp
diff options
context:
space:
mode:
authorJubilee <46493976+workingjubilee@users.noreply.github.com>2021-10-07 20:26:09 -0700
committerGitHub <noreply@github.com>2021-10-07 20:26:09 -0700
commit6c2d4bf3f7df75c60b6d81e9206a58aa30b0f8aa (patch)
tree9122ce7a4688f24b3c81c09d51b4a49c3c1534f8 /compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp
parent2ee06e737208ce1bd1c18df5ea3aba733e6ac2a7 (diff)
parenta17193dbb931ea0c8b66d82f640385bce8b4929a (diff)
downloadrust-6c2d4bf3f7df75c60b6d81e9206a58aa30b0f8aa.tar.gz
rust-6c2d4bf3f7df75c60b6d81e9206a58aa30b0f8aa.zip
Rollup merge of #87918 - mikebenfield:pr-afdo, r=nikic
Enable AutoFDO.

This largely involves implementing the options debug-info-for-profiling
and profile-sample-use and forwarding them on to LLVM.

AutoFDO can be used on x86-64 Linux like this:
rustc -O -Clink-arg='Wl,--no-rosegment' -Cdebug-info-for-profiling main.rs -o main
perf record -b ./main
create_llvm_prof --binary=main --out=code.prof
rustc -O -Cprofile-sample-use=code.prof main.rs -o main2

Now `main2` will have feedback directed optimization applied to it.

The create_llvm_prof tool can be obtained from this github repository:
https://github.com/google/autofdo

The option -Clink-arg='Wl,--no-rosegment' is necessary to avoid lld
putting an extra RO segment before the executable code, which would make
the binary silently incompatible with create_llvm_prof.
Diffstat (limited to 'compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp')
0 files changed, 0 insertions, 0 deletions