-
Notifications
You must be signed in to change notification settings - Fork 13k
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
Implement attributes for branch weight #11092
Labels
I-slow
Issue: Problems and improvements with respect to performance of generated code.
Comments
#36181 added |
Hi ! With #36181 being merged, it there any other changes needed to close this one ? Thank you ! |
Closing for the time being due to #36181. |
There is a reference to this issue in the code: rust/src/libstd/collections/hash/map.rs Lines 141 to 143 in a86f556
What needs to be done to remove that comment, now that this is closed? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The
cold
attribute exists for functions, but one might want to put weights on branches. This could have 3 forms;weight=N
where N is 0-1,likely
(1) andunlikely
(0).LLVM understands these annotations on branches already and can use these to fine-tune assembly to reduce branch mis-predictions. By nature, these could be used extensively in the standard library.
ie
There have been cases in Haskell libraries where changing the order of ADTs can increase performance by around 20% because branches are guessed differently by the compiler.
The text was updated successfully, but these errors were encountered: