dtolnay/cargo-llvm-lines

warning: ignoring emit path because multiple .ll files were produced

alex opened this issue · 1 comments

alex commented

This appears to be a re-occurrence of the issue reported in #4.

To reproduce:

$ git clone https://github.com/pyca/cryptography
$ cd cryptography/src/rust/
$ cargo llvm-lines --version
cargo-llvm-lines 0.4.26
$ cargo llvm-lines --no-default-features --release
   Compiling cryptography-rust v0.1.0 (/Users/alex_gaynor/projects/cryptography/src/rust)
warning: ignoring emit path because multiple .ll files were produced
    Finished release [optimized] target(s) in 8.28s
  Lines            Copies           Function name
  -----            ------           -------------
  3                1                (TOTAL)
  3 (100.0%,100.0%) 1 (100.0%,100.0%) <T as core::convert::Into<U>>::into
lqd commented

This looks to be related to ThinLTO specifically, which emits multiple .ll files in this situation.

Some workarounds (that are probably unsatisfying since you're likely trying to understand compile times in the actual config
you ship) to avoid that issue/warning:

  • using fat LTO
  • turning off LTO

Otherwise, with ThinLTO, using a single CGU would also give a bit more information (though I'm locally getting more than the 3 lines mentioned in the OP) in the range of 350K lines of IR, but I'm not sure how accurate that is.