-
Notifications
You must be signed in to change notification settings - Fork 12.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Emit optimization remarks to the final binary, not the console #96705
Labels
A-codegen
Area: Code generation
A-LLVM
Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Comments
RUSTFLAGS="-C llvm-args=--pass-remarks=.* -Cdebuginfo=2" cargo build --release does that work for you? |
It still pollutes my console. |
RUSTFLAGS="-C llvm-args=--pass-remarks-output=filename -Cdebuginfo=2" cargo build --release This fails because rustc does not know about: pass-remarks-output |
jyn514
changed the title
remarks
Emit optimization remarks to the final binary, not the console
Apr 9, 2023
jyn514
added
A-LLVM
Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
A-codegen
Area: Code generation
labels
Apr 9, 2023
matthiaskrgr
added a commit
to matthiaskrgr/rust
that referenced
this issue
May 6, 2023
Output LLVM optimization remark kind in `-Cremark` output Since rust-lang#90833, the optimization remark kind has not been printed. Therefore it wasn't possible to easily determine from the log (in a programmatic way) which remark kind was produced. I think that the most interesting remarks are the missed ones, which can lead users to some code optimization. Maybe we could also change the format closer to the "old" one: ``` note: optimization remark for tailcallelim at /checkout/src/libcore/num/mod.rs:1:0: marked this call a tail call candidate ``` I wanted to programatically parse the remarks so that they could work e.g. with https://github.com/OfekShilon/optview2. However, now that I think about it, probably the proper solution is to tell rustc to output them to YAML and then use the YAML as input for the opt remark visualization tools. The flag for enabling this does not seem to work though (rust-lang#96705 (comment)). Still I think that it's good to output the remark kind anyway, it's an important piece of information. r? `@tmiasko`
matthiaskrgr
added a commit
to matthiaskrgr/rust
that referenced
this issue
May 6, 2023
Output LLVM optimization remark kind in `-Cremark` output Since rust-lang#90833, the optimization remark kind has not been printed. Therefore it wasn't possible to easily determine from the log (in a programmatic way) which remark kind was produced. I think that the most interesting remarks are the missed ones, which can lead users to some code optimization. Maybe we could also change the format closer to the "old" one: ``` note: optimization remark for tailcallelim at /checkout/src/libcore/num/mod.rs:1:0: marked this call a tail call candidate ``` I wanted to programatically parse the remarks so that they could work e.g. with https://github.com/OfekShilon/optview2. However, now that I think about it, probably the proper solution is to tell rustc to output them to YAML and then use the YAML as input for the opt remark visualization tools. The flag for enabling this does not seem to work though (rust-lang#96705 (comment)). Still I think that it's good to output the remark kind anyway, it's an important piece of information. r? ``@tmiasko``
matthiaskrgr
added a commit
to matthiaskrgr/rust
that referenced
this issue
May 6, 2023
Output LLVM optimization remark kind in `-Cremark` output Since rust-lang#90833, the optimization remark kind has not been printed. Therefore it wasn't possible to easily determine from the log (in a programmatic way) which remark kind was produced. I think that the most interesting remarks are the missed ones, which can lead users to some code optimization. Maybe we could also change the format closer to the "old" one: ``` note: optimization remark for tailcallelim at /checkout/src/libcore/num/mod.rs:1:0: marked this call a tail call candidate ``` I wanted to programatically parse the remarks so that they could work e.g. with https://github.com/OfekShilon/optview2. However, now that I think about it, probably the proper solution is to tell rustc to output them to YAML and then use the YAML as input for the opt remark visualization tools. The flag for enabling this does not seem to work though (rust-lang#96705 (comment)). Still I think that it's good to output the remark kind anyway, it's an important piece of information. r? ```@tmiasko```
With #113040, remarks can now be outputted into a directory, in the same (YAML) format as |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
A-codegen
Area: Code generation
A-LLVM
Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Since #90833 rustc prints remarks with -Cremark to the console.
LLVM can include the remarks into the executable. Then you can read the remarks and analyze them.
https://llvm.org/docs/Remarks.html
I never managed to thread the flags through rustc.
The text was updated successfully, but these errors were encountered: