Skip to content

Conversation

DaniPopes
Copy link
Contributor

Since rust-lang/rust#120370 #[cold] affects branch weights in the backend (again?). Re-implement likely and unlikely in terms of a #[cold] function.

You can verify that the LLVM IR in this godbolt link contains a branch_weights metadata.

These were removed in d677fd4.

Since rust-lang/rust#120370 `#[cold]`
affects branch weights in the backend (again?). Re-implement
`likely` and `unlikely` in terms of a `#[cold]` function.

You can verify that the LLVM IR in [this godbolt link](https://godbolt.org/z/n3v7hsMqK)
contains a `branch_weights` metadata.

These were removed in rust-lang@d677fd4.
@Amanieu Amanieu added this pull request to the merge queue Aug 7, 2025
Merged via the queue into rust-lang:master with commit 4358483 Aug 7, 2025
26 checks passed
@DaniPopes DaniPopes deleted the readd-likely branch August 7, 2025 23:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants