-
Notifications
You must be signed in to change notification settings - Fork 13.1k
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
Disable LLVM verification by default #51230
Conversation
r? @pnkfelix (rust_highfive has picked a reviewer for you, use r? to override) |
Ping from triage @pnkfelix! This PR needs your review. |
Ping from triage, @pnkfelix / @rust-lang/compiler, this PR needs your review. |
Sidenote: I do dislike the If you change this to a |
Currently -Z no-verify only controls IR verification prior to LLVM codegen, while verification is performed unconditionally both before and after linking with (Thin)LTO.
This disables IR verification by default.
I've pushed a variant that renames Should I add a config.toml flag for this as well? |
seems sensible, people will want to turn this on for debugging llvm crashes. Can we turn this on on the dev-channel automatically? |
I've added an (untested) implementation of the config.toml flag. What does enabling it on the dev-channel mean? |
@bors try let's do a perf run |
Respect -Z no-verify during LTO Currently -Z no-verify only controls IR verification prior to LLVM codegen, while verification is performed unconditionally both before and after linking with (Thin)LTO. Also wondering what the sentiment is on disabling verification by default (and e.g. only enabling it on ALT builds with assertions). This does not seem terribly useful outside of rustc development and it does seem to show up in profiles (at something like 3%).
☀️ Test successful - status-travis |
Perf queued. |
So 1-3% improvement across the board (apart from check builds, which don't touch LLVM). |
Ping from triage @pnkfelix! This PR needs your review. |
I'm a little wary of turning off verification unconditionally across the board. I understand the sentiment that it is only useful for compiler development, but in practice I think it has caught bugs for us. Could we perhaps leave verification on by default in the nightly channel, and turn it off by default in the stable (and beta?) channels? Nominating for discussion at rustc team meeting. |
@bors r+ |
📌 Commit 3f18a41 has been approved by |
⌛ Testing commit 3f18a41 with merge 63d9e0003894440cad59003a0938d4c30a4d6f53... |
💔 Test failed - status-travis |
The job Click to expand the log.
I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
1 similar comment
The job Click to expand the log.
I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
Disable LLVM verification by default Currently -Z no-verify only controls IR verification prior to LLVM codegen, while verification is performed unconditionally both before and after linking with (Thin)LTO. Also wondering what the sentiment is on disabling verification by default (and e.g. only enabling it on ALT builds with assertions). This does not seem terribly useful outside of rustc development and it does seem to show up in profiles (at something like 3%). **EDIT:** A table showing the various configurations and what is enabled when. | Configuration | Dynamic verification performed | LLVM static assertions compiled in | | --- | --- | --- | | alt builds | | yes | | nightly builds | | no | | stable builds | | no | | CI builds | | | | dev builds in a checkout | | |
☀️ Test successful - status-appveyor, status-travis |
perf.rust-lang.org results show 1--3% speedups on lots of opt and debug benchmark builds: Nice work! |
Is there a nightly build with all verification, assertions (debug_asserts in rustc, in std, ...), LLVM assertions, etc. turned on that one can use during development? Like every now and then LLVM crashes and the first step to debug the issue is "recompile the world with LLVM with assertions enabled", which basically adds over one hour of cost upfront to start debugging an issue that might just end up being an user error. I would find something like |
I don't believe nightly builds exist but you can use https://crates.io/crates/rustup-toolchain-install-master with the |
…crum Improve verify_llvm_ir config option LLVM IR verification has been disabled by default in rust-lang#51230. However, the implementation doesn't quite match what was discussed in the discussion. This patch implements two changes: * Make `verify_llvm_ir` influence the behavior of the compiled rustc binary, rather than just the rustc build system. That is, if `verify_llvm_ir=true`, even manual invocations of the built rustc will verify LLVM IR. * Enable verification of LLVM IR in CI, for non-deploy and deploy-alt builds. This is similar to how LLVM assertions are handled.
Currently -Z no-verify only controls IR verification prior to LLVM codegen, while verification is performed unconditionally both before and after linking with (Thin)LTO.
Also wondering what the sentiment is on disabling verification by default (and e.g. only enabling it on ALT builds with assertions). This does not seem terribly useful outside of rustc development and it does seem to show up in profiles (at something like 3%).
EDIT: A table showing the various configurations and what is enabled when.