Make hint::cold_path #[cold] so that it works even if the MIR inliner can't inline it#156863
Conversation
|
r? @jackh726 rustbot has assigned @jackh726. Use Why was this reviewer chosen?The reviewer was selected based on:
|
This comment has been minimized.
This comment has been minimized.
|
@bors r+ |
Make hint::cold_path #[cold] so that it works even if the MIR inliner can't inline it This fixes rust-lang#156859 because the branch weight metadata is actually keyed off seeing a `#[cold]` function call in an arm. We don't need the intrinsic, any `#[cold]` function will do. So if the hint wrapper itself is made `#[cold]`, we will still get the desired effect, and LLVM will clean up the call to an empty function when optimizations are enabled.
…uwer Rollup of 8 pull requests Successful merges: - #156863 (Make hint::cold_path #[cold] so that it works even if the MIR inliner can't inline it) - #156875 (Correct and document semantics of `yield` terminator) - #157115 ([rustdoc] Fix foreign items macro expansion) - #157150 (Revert "drop derive helpers during ast lowering" ) - #156887 (Rename `-Zdebuginfo-for-profiling` switch) - #157039 (rustdoc: correctly propagate cfgs for glob reexports) - #157125 (Rewrite the `#[repr]` attribute parser) - #157154 (Revert workaround used to select the gcc codegen in the coretests CI)
Rollup merge of #156863 - saethlin:silly-cold-path, r=jackh726 Make hint::cold_path #[cold] so that it works even if the MIR inliner can't inline it This fixes #156859 because the branch weight metadata is actually keyed off seeing a `#[cold]` function call in an arm. We don't need the intrinsic, any `#[cold]` function will do. So if the hint wrapper itself is made `#[cold]`, we will still get the desired effect, and LLVM will clean up the call to an empty function when optimizations are enabled.
|
@rust-timer build 95a8ac2 Testing for #157161. |
|
Missing artifact for sha |
|
@rust-timer build 95a8ac2 |
This comment has been minimized.
This comment has been minimized.
|
Finished benchmarking commit (95a8ac2): comparison URL. Overall result: no relevant changes - no action neededBenchmarking means the PR may be perf-sensitive. Consider adding rollup=never if this change is not fit for rolling up. @rustbot label: -S-waiting-on-perf -perf-regression Instruction countThis perf run didn't have relevant results for this metric. Max RSS (memory usage)This perf run didn't have relevant results for this metric. CyclesThis perf run didn't have relevant results for this metric. Binary sizeThis perf run didn't have relevant results for this metric. Bootstrap: 515.367s -> 511.239s (-0.80%) |
This fixes #156859 because the branch weight metadata is actually keyed off seeing a
#[cold]function call in an arm. We don't need the intrinsic, any#[cold]function will do. So if the hint wrapper itself is made#[cold], we will still get the desired effect, and LLVM will clean up the call to an empty function when optimizations are enabled.