-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
MIR inliner not inlining through is_some_and
sometimes
#137901
Labels
A-mir-opt-inlining
Area: MIR inlining
Comments
is_some_and
sometimesis_some_and
sometimes
Weirdly, this seems to be due to using |
bors
added a commit
to rust-lang-ci/rust
that referenced
this issue
Mar 3, 2025
Improve the generic MIR in the default `PartialOrd::le` and friends It looks like I regressed this accidentally in rust-lang#137197 due to rust-lang#137901 So this PR does two things: 1. Tweaks the way we're calling `is_some_and` so that it optimizes in the generic MIR (rather than needing to optimize it in every monomorphization) -- the first commit adds a MIR test, so you can see the difference in the second commit. 2. Updates the implementations of `is_le` and friends to be slightly simpler, and parallel how clang does them.
bors
added a commit
to rust-lang-ci/rust
that referenced
this issue
Mar 3, 2025
Inline `FnOnce`/`FnMut`/`Fn` shims once again cc rust-lang#137901 r? `@ghost`
bors
added a commit
to rust-lang-ci/rust
that referenced
this issue
Mar 3, 2025
Inline `FnOnce`/`FnMut`/`Fn` shims once again cc rust-lang#137901 r? `@ghost`
bors
added a commit
to rust-lang-ci/rust
that referenced
this issue
Mar 3, 2025
Inline `FnOnce`/`FnMut`/`Fn` shims once again This PR fixes the argument checking for `extern "rust-call"` ABI functions with a spread arg, which do no expect their arguments to be exploded from a tuple like closures do. Secondly, it removes the hack that prevented them from being inlined. This results in more work done by the compiler, but it does end up allowing us to inline functions we didn't before. Fixes rust-lang#137901
workingjubilee
added a commit
to workingjubilee/rustc
that referenced
this issue
Mar 7, 2025
…ilee Improve the generic MIR in the default `PartialOrd::le` and friends It looks like I regressed this accidentally in rust-lang#137197 due to rust-lang#137901 So this PR does two things: 1. Tweaks the way we're calling `is_some_and` so that it optimizes in the generic MIR (rather than needing to optimize it in every monomorphization) -- the first commit adds a MIR test, so you can see the difference in the second commit. 2. Updates the implementations of `is_le` and friends to be slightly simpler, and parallel how clang does them.
matthiaskrgr
added a commit
to matthiaskrgr/rust
that referenced
this issue
Mar 7, 2025
…ilee Improve the generic MIR in the default `PartialOrd::le` and friends It looks like I regressed this accidentally in rust-lang#137197 due to rust-lang#137901 So this PR does two things: 1. Tweaks the way we're calling `is_some_and` so that it optimizes in the generic MIR (rather than needing to optimize it in every monomorphization) -- the first commit adds a MIR test, so you can see the difference in the second commit. 2. Updates the implementations of `is_le` and friends to be slightly simpler, and parallel how clang does them.
rust-timer
added a commit
to rust-lang-ci/rust
that referenced
this issue
Mar 7, 2025
Rollup merge of rust-lang#137904 - scottmcm:ordering-is, r=workingjubilee Improve the generic MIR in the default `PartialOrd::le` and friends It looks like I regressed this accidentally in rust-lang#137197 due to rust-lang#137901 So this PR does two things: 1. Tweaks the way we're calling `is_some_and` so that it optimizes in the generic MIR (rather than needing to optimize it in every monomorphization) -- the first commit adds a MIR test, so you can see the difference in the second commit. 2. Updates the implementations of `is_le` and friends to be slightly simpler, and parallel how clang does them.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Noticed in 2025-03-01 (which at time of writing isn't on godbolt yet) that the MIR for
<=
for a generated type still containshttps://play.rust-lang.org/?version=nightly&mode=release&edition=2024&gist=57c2829c1cf0a8778926bd87a0378feb
I can workaround that particular case, but calls to trivial functions like
is_le
really ought to MIR-inline, even if done through the voldemort function item like this.The text was updated successfully, but these errors were encountered: