rust/compiler
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
..
2021-09-20 22:21:42 -04:00
2021-09-20 22:21:42 -04:00
2021-09-20 22:21:42 -04:00
2021-09-20 22:21:42 -04:00
2021-10-03 16:08:50 +02:00
2021-10-06 19:36:52 +00:00
2021-10-06 20:23:57 +02:00
2021-09-20 22:21:42 -04:00
2021-09-20 22:21:42 -04:00
2021-10-06 08:40:28 -05:00
2021-10-06 19:36:52 +00:00
2021-09-20 22:21:42 -04:00
2021-10-06 13:10:08 -05:00
2021-10-06 20:37:24 +02:00
2021-09-20 22:21:42 -04:00
2021-10-03 16:08:57 +02:00
2021-09-20 22:21:42 -04:00
2021-10-06 19:36:52 +00:00
2021-10-03 16:08:54 +02:00