-
Notifications
You must be signed in to change notification settings - Fork 13.3k
inline(always)
for lt
/le
/ge
/gt
on integers and floats
#110935
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
I happened to notice one of these not getting inlined as part of `Range::next` in <https://rust.godbolt.org/z/4WKWWxj1G> ```rust bb1: { StorageLive(_5); _6 = &mut _4; StorageLive(_21); StorageLive(_14); StorageLive(_15); _15 = &((*_6).0: usize); StorageLive(_16); _16 = &((*_6).1: usize); _14 = <usize as PartialOrd>::lt(move _15, move _16) -> bb7; } ``` So since a call for something this trivial is never the right choice, `#[inline(always)]` seems appropriate.
Hey! It looks like you've submitted a new PR for the library teams! If this PR contains changes to any Examples of
|
(rustbot has picked a reviewer for you, use r? to override) |
I don't think this should be perf-relevant, since the MIR inliner will already be inlining them almost always, but just in case... |
This comment has been minimized.
This comment has been minimized.
⌛ Trying commit 8857cc2 with merge 6c1a0267c787582839d81193b869347a06a55abf... |
☀️ Try build successful - checks-actions |
This comment has been minimized.
This comment has been minimized.
Finished benchmarking commit (6c1a0267c787582839d81193b869347a06a55abf): comparison URL. Overall result: ❌ regressions - no 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. @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.
CyclesThis benchmark run did not return any relevant results for this metric. |
@bors r+ |
☀️ Test successful - checks-actions |
Finished benchmarking commit (c1bb0e0): comparison URL. Overall result: no relevant changes - no action needed@rustbot label: -perf-regression Instruction countThis benchmark run did not return any relevant results for this metric. 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.
CyclesThis benchmark run did not return any relevant results for this metric. |
I happened to notice one of these not getting inlined as part of
Range::next
in https://rust.godbolt.org/z/4WKWWxj1GSo since a call for something that's just one instruction is never the right choice,
#[inline(always)]
seems appropriate, like we have it on things like the rotate methods on integers.