-
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
--test -Z lto
optimizes the benchmarks out
#11902
Comments
This is a fundamental problem of micro-benchmarks with an optimising compiler: it can and will change code in unexpected ways (including removing code that it sees as dead, i.e. results that are not used where the computation is has no external effects). One way around this is to trick the compiler into thinking that a result is used. E.g. for a sufficiently compilcated computation (so the optimiser cannot constant-fold it): bh.iter(|| {
let result = /* calculation */;
if result == 0 { println!("no dead code elimination"); }
}) (works best if Even the stdlib has many instances of benchmarks that have their contents removed with optimisations on. I would think that the change that LTO introduces is (a) just giving LLVM more passes with which to reduce and eliminate code, and (b) allowing the benchmarking harness (specifically the In any case, I believe this is a dupe of #8261. |
…icola Increase defalt chalk overflow depth to match max solver size TBC: - rust-lang#12279: ok above 480 - ~~rust-lang#12182~~ - ~~rust-lang#12095~~ - rust-lang#11902: ok above 350 - ~~rust-lang#11668~~ - rust-lang#11370: ok above 450 - rust-lang#9754: probably ok above 250 (!), and the code in cause and branch are gone Closes rust-lang#12279 Closes rust-lang#11902 Closes rust-lang#11370 Closes rust-lang#9754
…ogiq Add `ineffective_open_options` lint Fixes rust-lang/rust-clippy#9628. For `OpenOptions`, in case you call both `write(true)` and `append(true)` on `OpenOptions`, then `write(true)` is actually useless since `append(true)` does it. r? `@flip1995` changelog: Add `ineffective_open_options` lint
Without LTO:
With LTO:
The text was updated successfully, but these errors were encountered: