Measuring rustc time spent on register allocation?

Is there a way to measure how much time rustc spends on register allocation on x86_64 ? Is it typically < 1% or > 1% of the total compile time ?

If you use the nightly toolchain and set RUSTFLAGS="-Ztime-llvm-passes -Ccodegen-units=1", the output will include information about register allocation passes.

1 Like

Is it by design that this is impossible on stable? I am getting error:

  error: the option `Z` is only accepted on the nightly compiler

(i.e. is this eventually hitting stable, or is it on purpose that timing is only on nightly)

I believe most things that directly expose LLVM interfaces/internals are perma-unstable, since rustc considers them implementation details that might need to change in the future.

5 Likes

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.