-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Do not count inline(always)
in inlining depth control
#108788
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
Conversation
@bors try @rust-timer queue |
This comment has been minimized.
This comment has been minimized.
⌛ Trying commit b9af0eed87a6ed5896be4e8c64ec327ea62025ad with merge ed8f2bd542b391447effacefb3f9a68e93d61e09... |
@@ -1484,11 +1487,11 @@ mod impls { | |||
where | |||
A: ~const PartialEq<B>, | |||
{ | |||
#[inline] | |||
#[inline(always)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since inlining is bottom-up, always
is usually not desirable on generic things, since it will inline-always the whole eq
implementation if it happens to get inlined into this one.
These situations really want some kind of inline(early)
that would inline the wrappers at MIR level without telling LLVM to alwaysinline
them.
@@ -1391,17 +1391,17 @@ mod impls { | |||
#[stable(feature = "rust1", since = "1.0.0")] | |||
#[rustc_const_unstable(feature = "const_cmp", issue = "92391")] | |||
impl const PartialOrd for $t { | |||
#[inline] | |||
#[inline(always)] | |||
fn partial_cmp(&self, other: &$t) -> Option<Ordering> { | |||
Some(self.cmp(other)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is dozens of lines of MIR, due to being a bunch of primitive operations and switches (https://rust.godbolt.org/z/jaazhve7E), so it's not clear to me that it should be always
'd.
It probably wants #105840 or a spaceship intrinsic to cut down the MIR size before doing it always.
☀️ Try build successful - checks-actions |
This comment has been minimized.
This comment has been minimized.
As mentioned in <rust-lang#108788 (comment)>, `Ord::cmp` on primitives generates a large amount of MIR, preventing (or at least discouraging) it from mir-inlining. Let's see whether making it a MIR primitive helps stuff -- derived `(Partial)Ord` in particular, if we're lucky.
@rust-timer build ed8f2bd542b391447effacefb3f9a68e93d61e09 |
This comment has been minimized.
This comment has been minimized.
Finished benchmarking commit (ed8f2bd542b391447effacefb3f9a68e93d61e09): comparison URL. Overall result: ❌ regressions - ACTION NEEDEDBenchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. While you can manually mark this PR as fit for rollup, we strongly recommend not doing so since this PR may lead to changes in compiler perf. Next Steps: If you can justify the regressions found in this try perf run, please indicate this with @bors rollup=never Instruction countThis is a highly reliable metric that was used to determine the overall result at the top of this comment.
Max RSS (memory usage)ResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
CyclesResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
|
☔ The latest upstream changes (presumably #112418) made this pull request unmergeable. Please resolve the merge conflicts. |
r? @ghost