rust/compiler/rustc_llvm
Jubilee 6c2d4bf3f7
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.
2021-10-07 20:26:09 -07:00
..
llvm-wrapper Rollup merge of #87918 - mikebenfield:pr-afdo, r=nikic 2021-10-07 20:26:09 -07:00
src Fix clippy lints 2021-10-01 23:17:19 +02:00
build.rs compiler/rustc_llvm: Enable M68k LLVM target 2021-09-17 15:07:14 +00:00
Cargo.toml Migrate to 2021 2021-09-20 22:21:42 -04:00