Repository navigation
Propagate block coldness across unwind edges and mark cold callsites - #165101
stephenduong1004 wants to merge 1 commit into
Conversation
|
rustbot has assigned @ShoyuVanilla. Use Why was this reviewer chosen?The reviewer was selected based on:
|
This comment has been minimized.
This comment has been minimized.
6492cd3 to
7c5e8c3
Compare
|
This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
|
Sorry, I'm not so confident with cg 😅 |
|
@rustbot reroll |
|
@bors try @rust-timer queue |
This comment has been minimized.
This comment has been minimized.
Propagate block coldness across unwind edges and mark cold callsites
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
Finished benchmarking commit (378b528): comparison URL. Overall result: ❌✅ regressions and improvements - please read:Benchmarking means the PR may be perf-sensitive. Consider adding rollup=never if this change is not fit for rolling up. Next, please: If you can, justify the regressions found in this try perf run in writing along with @bors rollup=iffy rustc-perf Instruction countOur most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.
Max RSS (memory usage)Results (secondary 0.9%)A less reliable metric. May be of interest, but not used to determine the overall result above.
CyclesResults (primary -3.7%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Binary sizeResults (primary 0.0%, secondary -0.1%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Bootstrap: 487.353s -> 486.845s (-0.10%) |
|
☔ The latest upstream changes (presumably #166674) made this pull request unmergeable. Please resolve the merge conflicts by rebasing. |
During MIR codegen,
find_cold_blocksidentifies basic blocks that end inUnreachableor call a#[cold]function and propagates coldness backward to predecessor blocks when all of their successors are cold. However,Terminator::successorsincludesis_cleanuplandingpad edges on unwindingCallterminators. Because shared cleanup landingpads are also reachable from hot callsites and are not marked cold, any intermediate block on a panic path that makes an unwinding call (such ascore::fmt::Argument::new_displayorcore::fmt::Arguments::newbeforepanic_fmt) fails to be marked cold. In addition,rustc_codegen_ssaonly usedcold_blocksto attachunlikelybranch weights toSwitchIntterminators and never marked calls inside cold non-cleanup blocks with the LLVMcoldcallsite attribute.This PR filters out
is_cleanupsuccessors when propagating coldness backward infind_cold_blocksand addsBuilderMethods::apply_attrs_to_cold_callsiteinrustc_codegen_ssaandrustc_codegen_llvmand invoke it fromTerminatorCodegenHelper::do_call.