sembr src/profiling.md

This commit is contained in:
Tshepang Mbambo
2026-02-03 01:03:06 +02:00
parent 48760618e8
commit 0c6e040dad
+7 -5
View File
@@ -33,10 +33,11 @@ Since most of the time compiling rustc is spent in LLVM, the idea is that by
reducing the amount of code passed to LLVM, compiling rustc gets faster.
To use `cargo-llvm-lines` together with somewhat custom rustc build process, you can use
`-C save-temps` to obtain required LLVM IR. The option preserves temporary work products
created during compilation. Among those is LLVM IR that represents an input to the
optimization pipeline; ideal for our purposes. It is stored in files with `*.no-opt.bc`
extension in LLVM bitcode format.
`-C save-temps` to obtain required LLVM IR.
The option preserves temporary work products created during compilation.
Among those is LLVM IR that represents an input to the
optimization pipeline; ideal for our purposes.
It is stored in files with `*.no-opt.bc` extension in LLVM bitcode format.
Example usage:
```
@@ -105,7 +106,8 @@ rust.codegen-units = 0 # num_cpus
The llvm-lines output is affected by several options.
`rust.optimize = false` increases it from 2.1GB to 3.5GB and `codegen-units = 0` to 4.1GB.
MIR optimizations have little impact. Compared to the default `RUSTFLAGS="-Z
MIR optimizations have little impact.
Compared to the default `RUSTFLAGS="-Z
mir-opt-level=1"`, level 0 adds 0.3GB and level 2 removes 0.2GB.
As of <!-- date-check --> July 2022,
inlining happens in LLVM and GCC codegen backends,