-
Notifications
You must be signed in to change notification settings - Fork 13.4k
add optimization fuel checks to some mir passes #79117
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Conversation
r? @eddyb (rust_highfive has picked a reviewer for you, use r? to override) |
Hmm I updated that failing test to account for increased usage of fuel, but on the second CI run the used value changed. Right now I can't reproduce locally either (I can only get a fuel value of 7), so I don't thinkI know what's being run in CI... |
r? @oli-obk |
That difference could be because the test is run with optimizations on your system while it's run without optimizations on CI. Try adding
|
cc @rust-lang/wg-mir-opt |
compiler/rustc_mir/src/transform/multiple_return_terminators.rs
Outdated
Show resolved
Hide resolved
Thanks! @bors r+ |
📌 Commit 07de702 has been approved by |
Rollup of 14 pull requests Successful merges: - rust-lang#78961 (Make bad "rust-call" arguments no longer ICE) - rust-lang#79082 (Improve the diagnostic for when an `fn` contains qualifiers inside an `extern` block.) - rust-lang#79090 (libary: Forward compiler-builtins "asm" and "mangled-names" feature) - rust-lang#79094 (Add //ignore-macos to pretty-std-collections.rs) - rust-lang#79101 (Don't special case constant operands when lowering intrinsics) - rust-lang#79102 (Add two regression tests) - rust-lang#79110 (Remove redundant notes in E0275) - rust-lang#79116 (compiletest: Fix a warning in debuginfo tests on windows-gnu) - rust-lang#79117 (add optimization fuel checks to some mir passes) - rust-lang#79147 (Highlight MIR as Rust on GitHub) - rust-lang#79149 (Move capture lowering from THIR to MIR) - rust-lang#79155 (fix handling the default config for profiler and sanitizers) - rust-lang#79156 (Allow using `download-ci-llvm` from directories other than the root) - rust-lang#79164 (Permit standalone generic parameters as const generic arguments in macros) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
Fixes #77402
Inserts a bunch of calls to
consider_optimizing
. Note thatconsider_optimizing
is the method that actually decrements the fuel count, so the point at which it's called is when the optimization takes place, from a fuel perspective. This means that where we call it has some thought behind it:InstCombine
, where we gather optimizations in a pass and then mutate values, we probably would rather skip the gathering pass for performance reasons rather than skip the mutations afterwards.